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

套件詳情v2.1.0

rubber

橡膠是一種具有可自訂材質彈簧動畫的彈性底部面板組件。

AndroidiOSWebmacOSWindowsLinux
近 30 天下載
1.1萬
喜歡數
356
Pub 分數
160

安裝套件

flutter pub add rubber

套件介紹

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

Rubber 是一個適用於 Flutter 的靈活底部面板小部件,提供可自訂的材質風格彈簧動畫。它能在展開或收合時實現順暢、彈性的過渡效果,提升使用者互動體驗,帶來回應迅速且流暢的行為。非常適合用於對話方塊、側邊欄或任何需要動態由下往上呈現的 UI 元件。Rubber 支援所有主要平台,包含 Android、iOS、Web、macOS、Windows 與 Linux。其動畫系統建構於 Flutter 的物理引擎之上,讓開發者能夠精細調整彈跳效果與回應性。此套件輕量且能無縫整合至現有的 Flutter 應用程式中。

適用情境

  • 模態對話框
  • 互動抽屜
  • 底部導航面板
  • 表單疊加
  • 動態內容展開器

主要特色

  • 可自訂的彈簧動畫
  • 彈性拖曳行為
  • 跨平台支援
  • 平滑過渡物理效果
  • 與現有組件的輕鬆整合
  • 可設定的彈跳阻力

適合對象

  • 尋求動畫底部表單的開發者
  • 具有互動式 UI 元件的應用程式
  • 希望採用材質啟發式動效的設計人員
  • 針對多個平台的專案
  • Flutter 物理動畫的使用者

使用建議

  • 可能需要調整以獲得最佳彈簧手感
  • 不適合靜態或非互動式表單
  • 效能取決於動畫的複雜度
  • 僅限底部彈出面板使用情境
  • 需要理解物理參數

原始 README

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

Awesome Flutter

An elastic material bottom sheet implementation for Flutter.

Requires Flutter 3.44 or later and Dart 3.12 or later.

This is still an early preview, some behaviors can change or being removed. Every feedback, bug report or feature request is welcome, please send it at the issue tracker

Follow the Quick Start to add it to your project. Is also available the complete example in the repository to preview the library on your device.

Common interaction options can be configured directly on the sheet:

RubberBottomSheet(
  animationController: controller,
  lowerLayer: const MyBackground(),
  upperLayer: const MySheetContent(),
  draggable: true,
  snapThreshold: 0.4,
  minFlingVelocity: 700,
  completeFlingVelocity: 5000,
  scrimColor: Colors.black54,
  onScrimTap: controller.collapse,
);

Use strict bounds when the elastic overscroll effect is not appropriate:

final controller = RubberAnimationController(
  vsync: this,
  duration: const Duration(milliseconds: 250),
  boundsBehavior: RubberAnimationBoundsBehavior.strict,
);

Use controller.addListener(...) to observe the position continuously. Status listeners report direction and boundary transitions (forward, reverse, completed, and dismissed). Pixel bounds are automatically recalculated after size and orientation changes.

所屬分類

原始碼儲存庫

使用此套件的專案