搜尋套件、儲存庫與 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.



所屬分類

原始碼儲存庫

使用此套件的專案