개발자가 사전 정의된 동작을 가진 사용자 지정 스크롤바를 만들 수 있도록 해주는 플러터 패키지입니다. 스타일과 기능에서 유연성을 제공하여 다양한 플랫폼에서 고유한 스크롤바 디자인을 구현할 수 있습니다. 맞춤형 스크롤 경험을 필요로 하는 앱에 적합하며, 안드로이드, iOS, 웹, 맥OS, 윈도우, 리눅스 등 모든 주요 플랫폼을 지원합니다. 스크롤 중 시각적 피드백을 제공함으로써 사용자 상호작용을 향상시키면서 깔끔하고 반응성이 뛰어난 인터페이스를 유지합니다.
사용 사례
웹 애플리케이션에서의 사용자 정의 스크롤바 디자인
모바일 스크롤 가능한 목록에서 UX 향상
데스크톱 앱용 스크롤 인디케이터 맞춤 설정
긴 콘텐츠 화면에서 접근성 향상
플랫폼별 스크롤바 스타일 만들기
스크롤 가능한 위젯에 시각적 피드백 추가
주요 기능
사용자 정의 가능한 스크롤바 모양
사전 정의된 동작 모드
크로스 플랫폼 호환성
사용자 정의 애니메이션 지원
ScrollView와의 간편한 통합
기기 간 반응형 디자인
적합한 대상
시각적 커스터마이즈를 원하는 UI 디자이너
스크롤이 많은 인터페이스를 개발하는 개발자
다중 플랫폼을 대상으로 하는 앱
접근성 있는 스크롤이 필요한 프로젝트
사용자 경험의 완성도에 집중하는 팀
고려 사항
최적의 성능을 위해 추가적인 스타일링이 필요할 수 있습니다
행동 사용자 정의는 ScrollController 이해가 필요합니다
스크롤 피드백이 없는 미니멀리스트 디자인에는 적합하지 않습니다
중첩 스크롤 뷰에서의 잠재적 레이아웃 충돌
내장 테마가 네이티브 스크롤바에 비해 제한적임
원본 README
연결된 소스 저장소의 README 원문 스냅샷입니다. 최신 내용은 저장소에서 확인하세요.
A Flexible Scrollbar for Flutter
A flexible solution for custom scroll bars.
Foreword
A package has been designed to allow the creation of complex scroll bars. You can customize the scroll thumb, scroll line and add a label, that is positioned by the center of the scroll thumb by default, but you can customize its position as well. As those three things are created by builders called every time the scroll state is changed, you can add custom animations.
How to use
The usage is as simple as a built-in Scrollbar, only you can customize it a lot more.
Install
To install this package simply add the flexible_scrollbar to your dependencies in pubspec.yaml
To get a scrollbar simply wrap a scrollable widget with FlexibleScrollbar and pass a ScrollController to both FlexibleScrollbar and a scrollable widget:
But it's very simple and we are here to make complex scroll bars so let's see how.
Customization
For the main customization the FlexibleScrollbar widget has three builders: scrollThumbBuilder, scrollLineBuilder and scrollLabelBuilder. Each one of them has a ScrollbarInfo as a parameter and rebuild each time any of the fields of the ScrollbarInfo model has changed.
ScrollbarInfo model has the following properties:
Properties
Description
bool isScrolling
Changes when the user starts/strops the scroll body scrolling. The isDragging is not affected by it.
bool isDragging
Changes when the user starts/strops to drag the scroll thumb. The isScrolling is not affected by it.
double thumbMainAxisSize
Contains the calculated depending on the scroll body size thumb length.
double thumbMainAxisOffset
Contains the offset in pixels of the scroll thumb from the starting position.
AxisDirection scrollDirection
Has the scroll body scroll direction in it (up/down/left/right)
Using those builders you can make custom scrollbars such as the one shown in the example at the beginning. The scroll thumb from the example has been created with the following code: