• Stars
    star
    357
  • Rank 119,149 (Top 3 %)
  • Language
    Dart
  • License
    BSD 3-Clause "New...
  • Created over 5 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Story view for apps with stories.

story_view Pub

Story view for apps with stories.

πŸ‘¨β€πŸš€ Demo project here: storyexample

🍟 Watch video demo here: story_view demo Youtube

This a Flutter widget to display stories just like Whatsapp and Instagram. Can also be used inline/inside ListView or Column just like Google News app. Comes with gestures to pause, forward and go to previous page.

Features

πŸ•Ή Still image, GIF and video support (with caching enabled)

πŸ“ Gesture for pause, rewind and forward

⚜️ Caption for each story item

🎈 Animated progress indicator for each story item

And useful callback to perform meta functionalities including vertical swipe gestures.

Installation

To use this plugin, add story_view as a dependency in your pubspec.yaml file.

Usage

Import the package into your code

import "package:story_view/story_view.dart";

Look inside examples/example.dart on how to use this library. You can copy and paste the code into your main.dart and run to have a quick look.

Basics

Use StoryView to add stories to screen or view heirarchy. StoryView requires a list of StoryItem, each of which describes the view to be displayed on each story page, duration and so forth. This gives you the freedom to customize each page of the story.

There are shorthands provided to create common pages.

StoryItem.text is a shorthand to create a story page that displays only text.

StoryItem.pageImage creates a story item to display images with a caption.

StoryItem.inlineImage creates a story item that is intended to be displayed in a linear view hierarchy like List or Column

🍭 Both .inlineImage and pageImage support animated GIFs.

StoryItem.pageVideo creates a page story item with video media. Just provide your video url and get going.

Story controller, loaders and GIF support

While images load, it'll be a better experience to pause the stories until it's done. To achieve this effect, create a global instance of StoryController and use the shorthand StoryItem.pageImage or StoryItem.inlineImage while passing the same controller instance to it.

...
final controller = StoryController();

@override
Widget build(context) {
  List<StoryItem> storyItems = [
    StoryItem.text(...),
    StoryItem.pageImage(...),
    StoryItem.pageImage(...),
    StoryItem.pageVideo(
      ...,
      controller: controller,
    )
  ]; // your list of stories

  return StoryView(
    storyItems,
    controller: controller, // pass controller here too
    repeat: true, // should the stories be slid forever
    onStoryShow: (s) {notifyServer(s)},
    onComplete: () {},
    onVerticalSwipeComplete: (direction) {
      if (direction == Direction.down) {
        Navigator.pop(context);
      }
    } // To disable vertical swipe gestures, ignore this parameter.
      // Preferrably for inline story view.
  )
}

🍭 Now, tell your users some stories.

More Repositories

1

locationpicker

Location picker for Flutter.
Dart
152
star
2

go-gurl

Curl TUI with Go as Postman replacement
Go
84
star
3

overlapping_panels

Discord inspired navigation for Flutter apps
Dart
43
star
4

stylebender

No code style generator for fast moving indie web developers
TypeScript
33
star
5

3e

Next level 3d workflow inside VSCode.
TypeScript
16
star
6

gnewsclone

Google News Clone
Dart
10
star
7

storyexample

Library example for story_view : https://github.com/blackmann/story_view.git
Dart
10
star
8

ManyThings

Swift
9
star
9

socdn

Self hosted file server
CSS
6
star
10

fonted

Change workspace font for vscode
TypeScript
6
star
11

overlapping_panels_demo

Demo for overlapping_panels Flutter library
Dart
5
star
12

Wipe_Modules

Swift
5
star
13

wardrobe

Styled React βš›οΈ components to quickly bootstrap ideas.
TypeScript
5
star
14

react-chat-input

The missing chat input for React βš›οΈ
TypeScript
4
star
15

mit6006

Software Engineering Journey. I may document
Kotlin
3
star
16

tinyrenderer

Go
2
star
17

zig-sdl-3d-renderer

Zig
1
star
18

matter-experiments

MatterJS experiments
JavaScript
1
star
19

MCC-USSD

MCC USSD
Python
1
star
20

doctor

Opensource docx editor based on Facebook lexical
TypeScript
1
star
21

analog-display

Analog display experiment
JavaScript
1
star
22

SpaceShooter

GDScript
1
star
23

chillnerds

TypeScript
1
star
24

js-react-frontend-test

JavaScript
1
star
25

json

Custom JSON Placeholder server
JavaScript
1
star
26

blackmann.github.io

Home of the Super Creative πŸ„πŸ½
Astro
1
star
27

jsjsx

An idea worth exploring
JavaScript
1
star
28

blackmann

Haha, github says I discovered this secret
1
star
29

resteasy

Go
1
star
30

home-archive-2022-01

My home page now built with rust
Rust
1
star
31

ousa

An app to take account of contributions made by old students of Universal 2010
Python
1
star
32

c001start

Code competition 1 for the Boyssss
JavaScript
1
star
33

ekikiyen

This is an enhancement of the Ekiki Me promo from Vodafone
Java
1
star