Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/furkansarihan/story_viewer
Display stories in Flutter!
https://github.com/furkansarihan/story_viewer
Last synced: about 1 hour ago
JSON representation
Display stories in Flutter!
- Host: GitHub
- URL: https://github.com/furkansarihan/story_viewer
- Owner: furkansarihan
- License: mit
- Created: 2020-09-05T12:03:45.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2023-06-23T13:22:25.000Z (over 1 year ago)
- Last Synced: 2024-08-03T14:08:49.622Z (3 months ago)
- Language: Dart
- Homepage:
- Size: 294 KB
- Stars: 11
- Watchers: 2
- Forks: 5
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# 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
``` Dart
StoryViewer(
padding: EdgeInsets.all(8),
backgroundColor: Colors.white,
ratio: StoryRatio.r16_9,
stories: [
StoryItemModel(imageProvider: NetworkImage(imageURL)),
StoryItemModel(imageProvider: MemoryImage(memoryImage)),
StoryItemModel(imageProvider: AssetImage(assetName)),
],
userModel: UserModel(
username: username,
profilePicture: NetworkImage(profileURL),
),
);
```
Custom controller example with event listeners``` Dart
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 Name| Type | Description |
| ----------- | ----------- | ----------- |
| extended_image| Core | Caching images, slide out page |