Story constructor

const Story({
  1. Key? key,
  2. required IndexedWidgetBuilder momentBuilder,
  3. required MomentDurationGetter momentDurationGetter,
  4. required int momentCount,
  5. VoidCallback? onFlashForward,
  6. VoidCallback? onFlashBack,
  7. ProgressSegmentBuilder progressSegmentBuilder = Story.instagramProgressSegmentBuilder,
  8. double progressSegmentGap = 2.0,
  9. Duration progressOpacityDuration = const Duration(milliseconds: 300),
  10. double momentSwitcherFraction = 0.33,
  11. int startAt = 0,
  12. double? topOffset,
  13. 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);