Story Progress

pub package

A package provides an easy way to show horizontal progress like instagram stories in Flutter project

How to use

import 'package:story_progress/story_progress.dart';

  var _formKey = GlobalKey<StoryProgressState>(); 
  var _play = false;

StoryProgress(
       key: _formKey,
       progressCount: 4,
       width: width,
       duration: Duration(seconds: 3),
       onStatusChanged: (value) {
       WidgetsBinding.instance.addPostFrameCallback((_) {
          switch (value) {
             case Status.next:
              //       
             break;
             case Status.previous:
              //
             break;
             case Status.completed:
              ScaffoldMessenger.of(context).showSnackBar(SnackBar(
                          content: Text('Stories completed'),
                          duration: Duration(seconds: 1),
               ));
             break;
             }
           });
       },
)

Skip and Previous story

Use this function on onPressed event


_formKey.currentState.skip();
_formKey.currentState.previous();

Pause and Resume(start) story

Use this function on onPressed event


  _formKey.currentState.pause();
  _formKey.currentState.resume(); //

Libraries

story_progress