搜索插件、代码仓与 APP 分类

vs_scrollbar 封面
插件详情v1.0.0

vs_scrollbar

可自定义的滚动条,支持拖动以快速导航,适用于水平和垂直列表。

AndroidiOSWebmacOSWindowsLinux
近 30 天下载
6770
喜欢数
72
Pub 分数
150

安装插件

flutter pub add vs_scrollbar

插件介绍

基于插件公开信息、社区数据与项目使用情况整理的选型参考。

一个可自定义的滚动条,适用于 Flutter,可通过拖动快速浏览水平和垂直列表。它通过在所有主要平台上实现流畅、响应迅速的滚动交互来提升用户体验。该滚动条可适应不同的滚动方向,并可进行样式定制以匹配应用的美学风格。专为性能和灵活性而设计,可无缝集成到 ListView 和 SingleChildScrollView 等可滚动小部件中。

适合场景

  • 长列表中的快速导航
  • 应用中的自定义滚动条设计
  • 增强可滚动内容中的用户体验
  • 支持水平和垂直滚动
  • 改进可访问性在可滚动界面中

主要特点

  • 可拖动滚动条
  • 支持水平和垂直滚动
  • 高度可定制的外观
  • 跨平台兼容性
  • 流畅的交互反馈
  • 轻量且高效

适合对象

  • 开发滚动密集型应用的开发者
  • 希望自定义滚动指示器的设计人员
  • 需要可访问导航的应用程序
  • 跨平台 Flutter 项目
  • 以用户界面为中心的应用程序

使用建议

  • 可能需要额外的样式才能获得最佳外观
  • 对超大列表的性能影响
  • 有限的内置主题
  • 不适合极简UI设计
  • 需要与可滚动控件手动集成

原始 README

以下为关联源码仓库的 README 原文快照,最新内容请访问源码仓库。

vs_scrollbar Pub

Customizable ScrollBar that can be dragged for quick navigation supporting both Horizontal and Vertical list.


Table of Contents


Installing

Add to pubspec.yaml file

dependencies:
  vs_scrollbar: ^1.0.0

Import

import 'package:vs_scrollbar/vs_scrollbar.dart';

Package Details

Customizable ScrollBar that can be dragged for quick navigation supporting both Horizontal and Vertical list.

You can customize scrollbar's thickness, radius, set custom colors and handle support for list drag functionality with prebuilt methods of default ScrollBar for Flutter.

Control animation duration of scrollbar using scrollbarTimeToFade, scrollbarFadeDuration properties.

Drag Behaviour with scrollbar is by default supported, if ScrollController object is passed.

Wrap This ScrollBar to any ScrollableList.
SingleChildScrollView
GridView
ListView
Listview.builder

Example

Try out example code all parameters are optional, currently serving basic use case scenarios.

Horizontal List


Vertical List

Code example
// use same scrollController object to listview and scrollbar to support drag functionality
ScrollController _scrollController = ScrollController();

VsScrollbar(
   controller: _scrollController,
   showTrackOnHover: true,// default false
   isAlwaysShown: true, // default false
   scrollbarFadeDuration: Duration(milliseconds: 500), // default : Duration(milliseconds: 300)
   scrollbarTimeToFade: Duration(milliseconds: 800),// default : Duration(milliseconds: 600)
   style: VsScrollbarStyle(
            hoverThickness: 10.0, // default 12.0
            radius: Radius.circular(10), // default Radius.circular(8.0)
            thickness: 10.0, // [ default 8.0 ]
            color: Colors.purple.shade900, // default ColorScheme Theme
          ),
   child: ListView.builder(
             controller: _scrollController, 
             shrinkWrap: true,
             physics: BouncingScrollPhysics(),
             itemCount: 6,
             scrollDirection: Axis.vertical,
             itemBuilder: (BuildContext context, int index) {
                   return Container(
                          height: 100,
                          width: MediaQuery.of(context).size.width,
                          color: Colors.purple[900],
                          margin: EdgeInsets.all(15));
             },
   ),
)

VsScrollbar object properties

Name Type default Description
controller ScrollController null Controller for Scrollbar
scrollbarFadeDuration Duration Duration(milliseconds: 300) Sets scrollbar fade animation duration
scrollbarTimeToFade Duration Duration(milliseconds: 600) Fades scrollbar after certain duration
isAlwaysShown bool false controls visibility of scrollbar when ideal
showTrackOnHover bool false controls visibility of scrollbar while hovering
style VsScrollbarStyle VsScrollbarStyle() Style Class for VsScrollBar

VsScrollbarStyle object properties

Name Type default Description
color Color System ColorScheme Theme ScrollBar Color
radius Radius Radius.circular(8.0) Set Radius of ScrollBar
thickness double 8.0 Set Thickness of ScrollBar
hoverThickness double 12.0 Set Hover Thickness of ScrollBar

Pull request and feedback are always appreciated :)


Show some :heart: and star the repo.

GitHub followers Twitter Follow


:heart: Found this project useful?

If you found this project useful, then please consider giving it a :star: on Github and sharing it with your friends via social media.



所属分类

源码仓库

使用此插件的项目