FLUTTER ECOSYSTEM

VickySalunkhe/vs_scrollbar

수평 및 수직 목록을 모두 지원하는 사용자 정의 가능한 스크롤바로, 빠른 탐색을 위해 드래그할 수 있습니다.

vs_scrollbar 프로젝트 이미지
Stars
9
Forks
9
최근 푸시(UTC)
2023. 9. 15.
프로젝트 상태
활성
Vicky Salunkhe GitHub avatar
GITHUB User

Vicky Salunkhe ↗

Freelancer | Flutter | Full Stack Developer Spreading knowledge and Helping others through StackOverflow and Workshops. 2021 Top 1% 🏆 on StackOverflow

WritcoPune, India
언어C++CMakeDartHTMLSwiftCKotlinObjective-C

기술 주제

이 저장소가 배포한 패키지

사용 중인 의존성

의존성 목록 2 개
  • flutter{"sdk":"flutter"}
  • flutter_test개발 의존성{"sdk":"flutter"}

원본 README

아래는 영문 원문 스냅샷입니다. 최신 내용은 GitHub에서 확인하세요.

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

https://github.com/VickySalunkhe/vs_scrollbar/blob/main/example/assets/horizontal.webp


Vertical List

https://github.com/VickySalunkhe/vs_scrollbar/blob/main/example/assets/vertical.webp

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.


https://img.buymeacoffee.com/button-api/?text=Buy%20me%20a%20coffee&emoji=&slug=VickySalunkhe&button_colour=5F7FFF&font_colour=ffffff&font_family=Cookie&outline_colour=000000&coffee_colour=FFDD00