StoryItem.inlineImage constructor
StoryItem.inlineImage({})
Shorthand for creating inline image. controller
should be same instance as
one passed to the StoryView
Implementation
factory StoryItem.inlineImage({
required String url,
Text? caption,
required StoryController controller,
Key? key,
BoxFit imageFit = BoxFit.cover,
Map<String, dynamic>? requestHeaders,
bool shown = false,
bool roundedTop = true,
bool roundedBottom = false,
Widget? loadingWidget,
Widget? errorWidget,
EdgeInsetsGeometry? captionOuterPadding,
Duration? duration,
}) {
return StoryItem(
ClipRRect(
key: key,
child: Container(
color: Colors.grey[100],
child: Container(
color: Colors.black,
child: Stack(
children: <Widget>[
StoryImage.url(
url,
controller: controller,
fit: imageFit,
requestHeaders: requestHeaders,
loadingWidget: loadingWidget,
errorWidget: errorWidget,
),
Container(
margin: EdgeInsets.only(bottom: 16),
padding: captionOuterPadding?? EdgeInsets.symmetric(horizontal: 24, vertical: 8),
child: Align(
alignment: Alignment.bottomLeft,
child: Container(
child: caption?? const SizedBox.shrink(),
width: double.infinity,
),
),
),
],
),
),
),
borderRadius: BorderRadius.vertical(
top: Radius.circular(roundedTop ? 8 : 0),
bottom: Radius.circular(roundedBottom ? 8 : 0),
),
),
shown: shown,
duration: duration ?? Duration(seconds: 3),
);
}