AdvStoryTray class

A highly customizable animated story tray.

Circular or rectangular image with gradient border. Shows shimmer effect when tray image is getting ready to show.

When tapped, this widget starts a border rotation animation and stops the animation when AdvStory prepares the contents of the tray.

AdvStoryTray is a predefined component, any widget can be used as a story tray but it's recommended to create an animated tray by extending AnimatedTray class.


AdvStory checks the tray widget type when the tray builder is called. If tray is subtype of AnimatedTray, AdvStory prepares the tray content before displaying the story view and manages the starting and stopping of the tray animation.

See AnimatedTray for more information.

Inheritance

Constructors

AdvStoryTray.new({Key? key, required String url, Widget? username, Size size = const Size(80, 80), ShimmerStyle shimmerStyle = const ShimmerStyle(), BoxShape shape = BoxShape.circle, List<Color> borderGradientColors = const [Color(0xaf405de6), Color(0xaf5851db), Color(0xaf833ab4), Color(0xafc13584), Color(0xafe1306c), Color(0xaffd1d1d), Color(0xaf405de6)], double gapSize = 3, double strokeWidth = 2, Duration animationDuration = const Duration(milliseconds: 1200), double? borderRadius})
Creates a story tray to show in story tray list.

Properties

animationDuration Duration
Rotate animation duration of the border.
final
borderGradientColors List<Color>
Border gradient colors. Two same color creates a solid border.
final
borderRadius double
Radius of the border that wraps the tray image.
final
gapSize double
Transparent area size between image and the border.
final
hashCode int
The hash code for this object.
no setterinherited
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
shape BoxShape
Shap of the tray.
final
shimmerStyle ShimmerStyle
Style of the shimmer that showing while preparing the tray content.
final
size Size
Size of the story tray. For a circular tray, width and height must be equal.
final
strokeWidth double
Width of the stroke that wraps the tray image.
final
url String
Image url that shown as tray.
final
username Widget?
Name of the user who posted the story. This username is displayed below the story tray.
final

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() AnimatedTrayState<AdvStoryTray>
Creates the mutable state for this widget at a given location in the tree.
override
debugDescribeChildren() List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children.
inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep.
inherited
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) String
A string representation of this object.
inherited
toStringDeep({String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) String
Returns a string representation of this node and its descendants.
inherited
toStringShallow({String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a one-line detailed description of the object.
inherited
toStringShort() String
A short, textual description of this widget.
inherited

Operators

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