flutter_stories 0.2.1+1

Flutter Android iOS web

Widget that brings stories mechanism to your apps

flutter_stories #

example

Widget that brings stories mechanism to your apps

Advantages: #

  • Simple to use and intuitive API
  • Lightweight (~200 lines of code)
  • Feels familiar if you've used Instagram or Snapchat stories before
  • Can be used with Cupertino and Material packages independently

Usage #

Add flutter_stories to your pubspec.yaml

Example #

Full version can be found in example dir

showcase

Supported gestures #

  • Tap the right portion of the screen to switch to the next moment. You can specify onFlashForward callback to control app behavior in this case or when story finishes
  • Tap the left portion of the screen to switch to the previous moment. Similar to right tap, but uses onFlashBack
  • Long press (hold) the screen to hide the progress segments and pause story, release to show controls and unpause

API #

propertytyperequireddescription
momentCountinttrueSets the number of moments in story
momentDurationGetter(int index) => DurationtrueFunction that must return Duration for each moment
momentBuilder(BuildContext context, int index) => WidgettrueBuilder that gets executed for each moment
onFlashForward() => voidfalseGets executed when user taps the right portion of the screen on the last moment in story or when story finishes playing
onFlashBack() => voidfalseGets executed when user taps the left portion of the screen on the first moment in story
startAtintfalseDefaults to 0. Sets the index of the first moment that will be displayed
momentSwitcherFractiondoublefalseDefaults to 0.33. `sets the ratio of left and right tappable portions of the screen: left for switching back, right for switching forward
progressSegmentBuilder(BuildContext context, double progress, double gap) => WidgetfalseDefaults to Story.instagramProgressSegmentBuilder - Instagram-like minimalistic segment builder. Builder for each progress segment
progressSegmentGapdoublefalseDefaults to 2.0. Sets the gap between each progress segment
progressOpacityDurationDurationfalseDefaults to Duration(milliseconds: 300). Sets the duration for the progress bar show/hide animation
topOffsetdoublefalseDefaults to MediaQuery.of(context).padding.top. Sets the top offset of progress container
fullscreenboolfalseDefaults to true. If true hides the status bar via SystemChrome service
20
likes
100
pub points
73%
popularity

Widget that brings stories mechanism to your apps

Repository (GitHub)
View/report issues

Documentation

API reference

Uploader

elizarov.vanya@gmail.com

License

MIT (LICENSE)

Dependencies

flutter

More

Packages that depend on flutter_stories