Skip to content

a914-gowtham/story_progress

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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(); //

About

show horizontal progress like instagram stories.this is a flutter version of https://github.com/shts/StoriesProgressView

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published