StoryItem.pageImage constructor
StoryItem.pageImage({})
Factory constructor for page images. controller
should be same instance as
one passed to the StoryView
Implementation
factory StoryItem.pageImage({
required String url,
required StoryController controller,
Key? key,
BoxFit imageFit = BoxFit.fitWidth,
Text? caption,
bool shown = false,
Map<String, dynamic>? requestHeaders,
Widget? loadingWidget,
Widget? errorWidget,
EdgeInsetsGeometry? captionOuterPadding,
Duration? duration,
}) {
return StoryItem(
Container(
key: key,
color: Colors.black,
child: Stack(
children: <Widget>[
StoryImage.url(
url,
controller: controller,
fit: imageFit,
requestHeaders: requestHeaders,
loadingWidget: loadingWidget,
errorWidget: errorWidget,
),
SafeArea(
child: Align(
alignment: Alignment.bottomCenter,
child: Container(
width: double.infinity,
margin: EdgeInsets.only(
bottom: 24,
),
padding: captionOuterPadding?? EdgeInsets.symmetric(
horizontal: 24,
vertical: 8,
),
color: caption != null ? Colors.black54 : Colors.transparent,
child: caption?? const SizedBox.shrink(),
),
),
)
],
),
),
shown: shown,
duration: duration ?? Duration(seconds: 3),
);
}