Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Main #192

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

Main #192

Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 22 additions & 13 deletions lib/widgets/story_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}) {
Expand All @@ -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(
Expand Down Expand Up @@ -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,
Expand All @@ -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(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please there is a reason ClipRRect is there.
please add it back and implement your solution around it borderRadius:

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: <Widget>[
StoryImage.url(
Expand All @@ -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),
);
Expand Down