搜尋套件、儲存庫與 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

所屬分類

原始碼儲存庫

使用此套件的專案

暫無相關資料。