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

套件詳情v2.3.0

marquee

一個無限滾動文字的 Flutter 小部件。提供多種自訂選項,包括自訂滾動方向、持續時間、曲線以及每輪之後的暫停。

AndroidiOSWebmacOSWindowsLinux
近 30 天下載
10.3萬
喜歡數
1070
Pub 分數
150

安裝套件

flutter pub add marquee

套件介紹

根據套件公開資料產生的選型評估,僅供參考。

marquee 套件提供了一個 Flutter 小部件,可實現無限滾動文字,並具備廣泛的自訂選項。它支援多種滾動方向、可調節的持續時間、動畫曲線,以及每個週期後的可設定暫停。非常適合在有限空間內顯示長文字,例如標題或通知,透過跨所有主要平台的平滑連續動畫提升使用者體驗。此元件輕量且易於整合,適用於需要動態文字顯示的簡單與複雜使用情境。

適用情境

  • 在有限空間內顯示長標題
  • 建立動畫通知
  • 顯示股票代碼風格的新聞來源
  • 透過動態文字效果增強使用者介面
  • 實現滾動橫幅

主要特色

  • 無限文字滾動
  • 可自定的滾動方向
  • 可調整的動畫持續時間和曲線
  • 每次滾動週期後暫停
  • 支援多個平台
  • 與現有組件的輕鬆整合

適合對象

  • 需要動畫文字顯示的開發者
  • 設計師創造吸引人的使用者介面元素
  • 具有即時資料流的應用程式
  • 互動式自助服務終端或儀表板
  • 需要響應式文字動畫的項目

使用建議

  • 處理極長文字時可能影響效能
  • 需要仔細調整滾動速度與暫停時間
  • 不適合靜態內容
  • 螢幕閱讀器的可存取性考量
  • 對單個字元移動的控制有限

原始 README

以下為關聯原始碼儲存庫的 README 原文快照,最新內容請造訪原始碼儲存庫。

⏩ A Flutter widget that scrolls text infinitely. Provides many customizations including custom scroll directions, durations, curves as well as pauses after every round.

Appreciate the widget? Show some ❤️ and star the repo to support the project.

Usage

This is a minimalistic example:

Marquee(
  text: 'There once was a boy who told this story about a boy: "',
)

And here's a piece of code that makes full use of the marquee's customizability:

Marquee(
  text: 'Some sample text that takes some space.',
  style: TextStyle(fontWeight: FontWeight.bold),
  scrollAxis: Axis.horizontal,
  crossAxisAlignment: CrossAxisAlignment.start,
  blankSpace: 20.0,
  velocity: 100.0,
  pauseAfterRound: Duration(seconds: 1),
  startPadding: 10.0,
  accelerationDuration: Duration(seconds: 1),
  accelerationCurve: Curves.linear,
  decelerationDuration: Duration(milliseconds: 500),
  decelerationCurve: Curves.easeOut,
)

For more information about the properties, have a look at the API reference.

所屬分類

依賴

依賴清單 1 項

原始碼儲存庫

使用此套件的專案