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

套件詳情v1.0.7

dyn_mouse_scroll

用於可滾動組件的包裝器,可在所有平台實現滑鼠平滑捲動。

AndroidiOSWebmacOSWindowsLinux
近 30 天下載
749
喜歡數
42
Pub 分數
145

安裝套件

flutter pub add dyn_mouse_scroll

套件介紹

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

dyn_mouse_scroll 是一個 Flutter 套件,用來包裝可滾動組件,以在所有平台上實現平滑且一致的鼠標滾動效果,包括 Android、iOS、Web、macOS、Windows 和 Linux。它透過在使用鼠標時提供反應迅速且流暢的滾動行為來提升使用者體驗,無論目標平台為何。該套件可與現有的可滾動組件(如 ListView、ScrollViewController 等)無縫搭配,無需進行大量程式碼變更。它確保在桌面和 Web 環境中具有類似原生的滾動體驗,這些環境通常使用鼠標輸入。

適用情境

  • 增強桌面和網頁應用的捲動體驗
  • 改進資料密集型介面的可用性
  • 在跨平台應用中啟用平滑滾動
  • 支援清確的滑鼠導航於清單與格線
  • 在不同設備上添加一致的滾動行為

主要特色

  • 跨平台滑鼠滾動支援
  • 與現有可滾動組件的無縫整合
  • 流暢且響應迅速的捲動效能
  • 最小設定需求
  • 適用於 ListView、GridView 及其他可滾動元件

適合對象

  • 開發跨平台應用的開發者
  • 針對桌面與網頁使用者的應用程式
  • 具有長列表或複雜可滾動內容的 UI
  • 重視跨裝置體驗一致性的團隊

使用建議

  • 可能需要在行動裝置上進行額外測試
  • 對基於觸控的捲動影響有限
  • 對於僅依賴觸控輸入的應用程式來說,不需要
  • 最適合頻繁使用滑鼠互動的應用程式
  • 在非常大的數據集上可能有性能開銷

原始 README

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

Dynamic Mouse Scroll

A wrapper for scrollable widgets that enables smooth scrolling with a mouse on all platforms.

First gif: Scrolling slowly.
Second gif: Scrolling quickly (flick scroll).
Third gif: Mobile drag scroll detected, physics change.

Features

  • Animate smooth scroll based on speed of user's scroll.
  • Uses universal_io to detect if platform is mobile or desktop.
  • Automatically detect if the wrong ScrollPhysics is being used and update using provider.
  • Adjust the duration of your scroll events.
  • Choose what mobile physics you would like to use.

Basic Usage

DynMouseScroll(
  builder: (context, controller, physics) => ListView(
    controller: controller,
    physics: physics,
    children: ...
    )
)

Problem:

Flutter does not animate smooth scrolls for pointers, causing choppy experiences for the end user. One package, web_smooth_scroll, attempts to fix this problem by disabling default scrolling entirely (mobile can't drag now) and listening for pointer events to animate the scroll controller that can only move at one speed.

Solution:

To allow mobile default scrolling to still be accessible I detect the user's platform and automatically update if the detection was wrong. When the user scrolls, the 'futurePosition' variable is updated and the animation is started.

所屬分類

依賴

依賴清單 2 項

原始碼儲存庫

使用此套件的專案