Story constructor
const
Story({
- Key? key,
- required IndexedWidgetBuilder momentBuilder,
- required MomentDurationGetter momentDurationGetter,
- required int momentCount,
- VoidCallback? onFlashForward,
- VoidCallback? onFlashBack,
- ProgressSegmentBuilder progressSegmentBuilder = Story.instagramProgressSegmentBuilder,
- double progressSegmentGap = 2.0,
- Duration progressOpacityDuration = const Duration(milliseconds: 300),
- double momentSwitcherFraction = 0.33,
- int startAt = 0,
- double? topOffset,
- bool fullscreen = true,
Implementation
const Story({
Key? key,
required this.momentBuilder,
required this.momentDurationGetter,
required this.momentCount,
this.onFlashForward,
this.onFlashBack,
this.progressSegmentBuilder = Story.instagramProgressSegmentBuilder,
this.progressSegmentGap = 2.0,
this.progressOpacityDuration = const Duration(milliseconds: 300),
this.momentSwitcherFraction = 0.33,
this.startAt = 0,
this.topOffset,
this.fullscreen = true,
}) : assert(momentCount > 0),
assert(momentSwitcherFraction >= 0),
assert(momentSwitcherFraction < double.infinity),
assert(progressSegmentGap >= 0),
assert(momentSwitcherFraction < double.infinity),
assert(startAt >= 0),
assert(startAt < momentCount),
super(key: key);