flutter_stories 0.1.0+1

  • Readme
  • Changelog
  • Example
  • Installing
  • 79

flutter_stories #


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 pacakges independently

Usage #

Add flutter_stories to your pubspec.yaml

Example #

Full version can be found in example dir


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


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 executed for each moment
onFlashForward() => voidtruegets executed when user taps the right portion of the screen on the last moment in story or when story finishes playing
onFlashBack() => voidtruegets executed when user taps the left portion of the screen on the first moment in story
startAtintfalsesets the index of the first moment that will be displayed. defaults to 0
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. builder for each progress segment. defaults to Instagram-like minimalistic segment builder
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

[0.1.0+1] - 16.07.2019


[0.1.0] - 16.07.2019

Initial release


flutter_stories_example #

Shows a basic usage of flutter_stories package

Feel free to clone the repo and play with params and behavior

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:

  flutter_stories: ^0.1.0+1

2. Install it

You can install packages from the command line:

with Flutter:

$ flutter pub get

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:

import 'package:flutter_stories/flutter_stories.dart';
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

We analyzed this package on Oct 11, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.5.1
  • pana: 0.12.21
  • Flutter: 1.9.1+hotfix.4


Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Maintenance suggestions

The package description is too short. (-11 points)

Add more detail to the description field of pubspec.yaml. Use 60 to 180 characters to describe the package, what it does, and its target use case.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.2.2 <3.0.0
flutter 0.0.0
Transitive dependencies
collection 1.14.11 1.14.12
meta 1.1.7
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies