搜尋套件、儲存庫與 APP 分類

GitHub 儲存庫vanelizarov/flutter_stories

flutter_stories

為您的應用帶來故事機制的 Flutter 小部件

flutter_stories 專案封面
星標
35
分支
26
最近推送(UTC)
2024年6月21日
專案狀態
未封存

原始 README

以下為英文專案原文快照,最新內容請造訪 GitHub。

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
Ivan Elizarov GitHub avatar
GitHub 作者

Ivan Elizarov ↗

@MobileTeleSystemsMoscow, Russia
語言DartRubySwiftKotlinObjective-C

此儲存庫發佈的套件

使用的依賴

依賴清單 2 項

  • flutter{"sdk":"flutter"}
  • flutter_test開發依賴{"sdk":"flutter"}

如何選擇適合專案的儲存庫?

先依使用情境篩選,再比較專案活躍情況,最後到原始儲存庫確認使用要求。

  1. 透過儲存庫名稱、作者或描述搜尋,再依技術分類縮小範圍。
  2. 綜合星標、分支與最近推送比較專案;星標反映社群關注,不保證品質。
  3. 使用前在 GitHub 確認 README、授權條款與 Issues。

來源與維護

“A repository is the most basic element of GitHub.”

GitHub Docs — About repositories ↗