story_widget 0.0.2 copy "story_widget: ^0.0.2" to clipboard
story_widget: ^0.0.2 copied to clipboard

A story widget for socail app in which user can add both the video and image

Story Widget #

Implement the story like Facebook, Instagram

πŸ—Ύ Demo Image:

Demo image

🍟 Demo Video:

https://drive.google.com/file/d/19SzAf48VJcH03xQI781K1OZvd7w8uo63/view?usp=sharing

Features #

Create a story widget for listing the list of images, and videos for users to view like Instagram and Facebook story

πŸ–ΌοΈ Play image in the certain duration πŸŽ₯ Video 🎧 Combine the audio in the story with image type

Usage #

In this library, we use two models to implement the display of the item story in the view.

The first model is StoryListModel: this provides a list of stories that can be displayed in the view as personal stories.

In this model, we can set your custom data inside it as a personal use-case.

class StoryListModel<A, B> {
  final String id;
  final A? data;
  final List<StoryModel<B>> stories;

  StoryListModel({
    required this.id,
    required this.stories,
    this.data,
  });
}

The second model is StoryModel: this is the data of one story We will give the optional thumbnail URL for video type if you have one. storyType will be divided into two types: Image and video. So careful to check your asset

class StoryModel<A> {
  final A? data;
  final String imageUrl;
  String thumbnailUrl;
  final StoryImageType storyType;

  bool isThumbnailUrl = true;
  final isInitialize = ValueNotifier(false);
  final isInitThumbnail = ValueNotifier(false);
  late VideoPlayerController? videoPlayer = null;

  StoryModel(
      {this.data,
      this.imageUrl = '',
      this.thumbnailUrl = '',
      this.storyType = StoryImageType.Image});
}

By using it in your project. Just use StoryWidget widget.

5
likes
130
points
30
downloads

Publisher

unverified uploader

Weekly Downloads

A story widget for socail app in which user can add both the video and image

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSL-1.0 (license)

Dependencies

audioplayers, cached_network_image, flutter, path_provider, video_player

More

Packages that depend on story_widget