StoryItem class

This is a representation of a story item (or page).

Constructors

StoryItem(Widget view, {required Duration duration, bool shown = false})
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})
Shorthand for creating inline image. controller should be same instance as one passed to the StoryView
factory
StoryItem.inlineProviderImage(ImageProvider<Object> image, {Key? key, Text? caption, bool shown = false, bool roundedTop = true, bool roundedBottom = false, Duration? duration})
Shorthand for creating an inline story item from an image provider such as AssetImage or NetworkImage. However, the story continues to play while the image loads up.
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})
Factory constructor for page images. controller should be same instance as one passed to the StoryView
factory
StoryItem.pageProviderImage(ImageProvider<Object> image, {Key? key, BoxFit imageFit = BoxFit.fitWidth, String? caption, bool shown = false, Duration? duration})
Shorthand for creating a story item from an image provider such as AssetImage or NetworkImage. However, the story continues to play while the image loads up.
factory
StoryItem.pageVideo(String url, {required StoryController controller, Key? key, Duration? duration, BoxFit imageFit = BoxFit.fitWidth, Widget? caption, bool shown = false, Map<String, dynamic>? requestHeaders, Widget? loadingWidget, Widget? errorWidget})
Shorthand for creating page video. controller should be same instance as one passed to the StoryView
factory

Properties

duration Duration
Specifies how long the page should be displayed. It should be a reasonable amount of time greater than 0 milliseconds.
final
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
shown bool
Has this page been shown already? This is used to indicate that the page has been displayed. If some pages are supposed to be skipped in a story, mark them as shown shown = true.
getter/setter pair
view Widget
The page content
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

text({required String title, required Color backgroundColor, Key? key, TextStyle? textStyle, bool shown = false, bool roundedTop = false, bool roundedBottom = false, EdgeInsetsGeometry? textOuterPadding, Duration? duration}) StoryItem
Short hand to create text-only page.