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,
String? caption,
bool shown = false,
Map<String, dynamic>? requestHeaders,
Duration? duration,
}) {
return StoryItem(
Container(
key: key,
color: Colors.black,
child: Stack(
children: <Widget>[
StoryImage.url(
url,
controller: controller,
fit: imageFit,
requestHeaders: requestHeaders,
),
SafeArea(
child: Align(
alignment: Alignment.bottomCenter,
child: Container(
width: double.infinity,
margin: EdgeInsets.only(
bottom: 24,
),
padding: EdgeInsets.symmetric(
horizontal: 24,
vertical: 8,
),
color: caption != null ? Colors.black54 : Colors.transparent,
child: caption != null
? Text(
caption,
style: TextStyle(
fontSize: 15,
color: Colors.white,
),
textAlign: TextAlign.center,
)
: SizedBox(),
),
),
)
],
),
),
shown: shown,
duration: duration ?? Duration(seconds: 3),
);
}