diff --git a/lib/widgets/story_view.dart b/lib/widgets/story_view.dart index 3a6e8db1..deef4276 100644 --- a/lib/widgets/story_view.dart +++ b/lib/widgets/story_view.dart @@ -56,6 +56,8 @@ class StoryItem { bool shown = false, bool roundedTop = false, bool roundedBottom = false, + double roundedBottomRadius = 8.0, + double roundedTopRadius = 8.0, EdgeInsetsGeometry? textOuterPadding, Duration? duration, }) { @@ -75,8 +77,8 @@ class StoryItem { decoration: BoxDecoration( color: backgroundColor, borderRadius: BorderRadius.vertical( - top: Radius.circular(roundedTop ? 8 : 0), - bottom: Radius.circular(roundedBottom ? 8 : 0), + top: Radius.circular(roundedTop ? roundedTopRadius : 0), + bottom: Radius.circular(roundedBottom ? roundedBottomRadius : 0), ), ), padding: textOuterPadding?? EdgeInsets.symmetric( @@ -159,7 +161,7 @@ class StoryItem { /// Shorthand for creating inline image. [controller] should be same instance as /// one passed to the `StoryView` - factory StoryItem.inlineImage({ + factory StoryItem.inlineImage({ required String url, Text? caption, required StoryController controller, @@ -169,18 +171,30 @@ class StoryItem { bool shown = false, bool roundedTop = true, bool roundedBottom = false, + double roundedBottomRadius = 8.0, + double roundedTopRadius = 8.0, Widget? loadingWidget, Widget? errorWidget, EdgeInsetsGeometry? captionOuterPadding, Duration? duration, }) { return StoryItem( - ClipRRect( - key: key, - child: Container( - color: Colors.grey[100], + Container( + decoration:BoxDecoration( + color: Colors.green, + borderRadius: BorderRadius.vertical( + top: Radius.circular(roundedTop ? roundedTopRadius : 0), + bottom: Radius.circular(roundedBottom ? roundedBottomRadius : 0), + ), + ), child: Container( - color: Colors.black, + decoration:BoxDecoration( + color: Colors.black, + borderRadius: BorderRadius.vertical( + top: Radius.circular(roundedTop ? roundedTopRadius : 0), + bottom: Radius.circular(roundedBottom ? roundedBottomRadius : 0), + ), + ), child: Stack( children: [ StoryImage.url( @@ -206,11 +220,6 @@ class StoryItem { ), ), ), - borderRadius: BorderRadius.vertical( - top: Radius.circular(roundedTop ? 8 : 0), - bottom: Radius.circular(roundedBottom ? 8 : 0), - ), - ), shown: shown, duration: duration ?? Duration(seconds: 3), );