搜索插件、代码仓与 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 项

源码仓库

使用此插件的项目