This articles explains you how to create story view in flutter applications to display stories like facebook, instagram, whatsapp etc. We are using story_view package to implement this view in flutter app.
Nowadays stories are most used in social media applications to display status etc. In this flutter example, we are going to implement story view in our flutter apps. We will display story in form of text, image and video in this story view.
story_view package has many features. We can also share simple text status story. We can also captain each story item in this story view. We can also pause, previous and next story using gestures. Progress Indicator is also displayed on top of every story view.
There are many properties in this story_view package. controller attribute is used to control playback of the stories. storyItems property takes list parameter to display multiple pages or stories. onComplete callback is used to detect story is completed or not.
onVerticalSwipeComplete callback is used to detect vertical swipe gesture. onStoryShow callback is used to detect story is currently being shown or not. progressPosition attribute is used to decide where progress indicator is displayed.
Add required dependency in your pubspec.yaml file
Story View Flutter
StoryItem.pageImage widget is used to take image url as parameter to display image in story. We can also display text in stories using StoryItem.text widget. We can also display video in stories like image.