搜索插件、代码仓与 APP 分类

flutter_stories 封面
插件详情v0.3.1

flutter_stories

为您的应用带来故事机制的 Widget

AndroidiOSWebmacOSWindowsLinux
近 30 天下载
197
喜欢数
69
Pub 分数
140

安装插件

flutter pub add flutter_stories

插件介绍

基于插件公开信息、社区数据与项目使用情况整理的选型参考。

Flutter Stories 是一个 Flutter 包,实现了类似于社交媒体应用中的故事浏览机制。它提供了一个可自定义的组件,用于以全屏滑动格式显示顺序内容,如图片、视频或文本。该包专为跨平台使用而设计,支持 Android、iOS、Web、macOS、Windows 和 Linux。该包使开发者能够以最少的设置和高性能轻松地将类似故事的体验集成到其应用程序中。

适合场景

  • 社交媒体应用更新
  • 用户入门教程
  • 产品展示功能
  • 交互式内容幻灯片
  • 实时事件亮点

主要特点

  • 滑动浏览故事
  • 可自定义的故事时长
  • 支持图片、视频和小部件
  • 跨平台兼容性
  • 内置进度指示器
  • 与现有用户界面的轻松集成

适合对象

  • 开发社交应用的开发者
  • 创建交互式入门流程的团队
  • 设计师实现视觉叙事
  • 需要限时内容展示的应用程序
  • 需要轻量级故事组件的项目

使用建议

  • 需要仔细处理大型媒体文件
  • 可能需要自定义样式以保持品牌一致性
  • 有限的内置动画选项
  • 未针对非常长的故事序列进行优化
  • 依赖外部依赖项进行视频播放

原始 README

以下为关联源码仓库的 README 原文快照,最新内容请访问源码仓库。

flutter_stories

example

Widget that brings stories mechanism to your apps

Advantages:

  • Simple to use and intuitive API
  • Lightweight (~200 lines of code)
  • Feels familiar if you've used Instagram or Snapchat stories before
  • Can be used with Cupertino and Material packages independently

Usage

Add flutter_stories to your pubspec.yaml

Example

Full version can be found in example dir

showcase

Supported gestures

  • Tap the right portion of the screen to switch to the next moment. You can specify onFlashForward callback to control app behavior in this case or when story finishes
  • Tap the left portion of the screen to switch to the previous moment. Similar to right tap, but uses onFlashBack
  • Long press (hold) the screen to hide the progress segments and pause story, release to show controls and unpause

API

property type required description
momentCount int true Sets the number of moments in story
momentDurationGetter (int index) => Duration true Function that must return Duration for each moment
momentBuilder (BuildContext context, int index) => Widget true Builder that gets executed for each moment
onFlashForward () => void false Gets executed when user taps the right portion of the screen on the last moment in story or when story finishes playing
onFlashBack () => void false Gets executed when user taps the left portion of the screen on the first moment in story
startAt int false Defaults to 0. Sets the index of the first moment that will be displayed
momentSwitcherFraction double false Defaults to 0.33. `sets the ratio of left and right tappable portions of the screen: left for switching back, right for switching forward
progressSegmentBuilder (BuildContext context, double progress, double gap) => Widget false Defaults to Story.instagramProgressSegmentBuilder - Instagram-like minimalistic segment builder. Builder for each progress segment
progressSegmentGap double false Defaults to 2.0. Sets the gap between each progress segment
progressOpacityDuration Duration false Defaults to Duration(milliseconds: 300). Sets the duration for the progress bar show/hide animation
topOffset double false Defaults to MediaQuery.of(context).padding.top. Sets the top offset of progress container
fullscreen bool false Defaults to true. If true hides the status bar via SystemChrome service

所属分类

源码仓库

使用此插件的项目

暂无相关数据。