story_viewer

This package provides common story view experience for any Flutter app.

Features

  • Complate known gestures;
    • next story, previous story
    • hide UI layer on long press
  • Custom texts, icons, colors, paddings etc.
  • Easy to implement data model for story and story owner user.
  • Slide out page on vertical swipe down
  • Reply a story just like Instagram with text or emojis on vertical swipe up
  • **Display ratio for dynamic view inside any Widget.
  • Listener support with callbacks for story with StoryViewerController
    • played, paused, story index changed etc.
  • Customized additional layers support for under or on the media layer.
  • Blurred layer for possible inappropriate media

** Default and fully tested ratio is 9:16 with full screen.

Usage

This is common usage of story_viewer

StoryViewer(
    padding: EdgeInsets.all(8),
    backgroundColor: Colors.white,
    ratio: StoryRatio.r16_9,
    stories: [
        StoryItemModel(url:"a_url"),
        StoryItemModel(url:"a_url"),
        StoryItemModel(url:"a_url"),
    ],
    userModel: UserModel(
        username: "story_viewer",
        profilePictureUrl: "profile_url",
    ),
);

Custom controller example with event listeners

StoryViewerController controller = StoryViewerController();
controller.addListener(
    onPlayed: () {
        print("'onPlayed' callback outside of story_viewer");
    },
    onPaused: () {
        print("'onPaused' callback outside of story_viewer");
    },
);
return StoryViewer(
    viewerController: controller,
    .
    .

Check out example/lib/detailed_example.dart for more!

Dependencies

Package NameTypeDescription
extended_imageCoreCaching images, slide out page
flutter_screenutilCoreDevice-Size spesific visual behaviours
flutter_spinkitVisualLoading animation

Libraries

blur_slider
customizer
fast_emojis
gradient_back
gradient_shadow
layer_additional
layer_media
layer_ui
placeholder_image
profile_row
progress_row
progress_widget
reply_row
source_row
story_item
story_viewer
user
viewer
viewer_controller