사용자가 아래로 스크롤할 때 자동으로 '맨 위로 스크롤' 표시기를 표시하도록 스크롤 가능한 위젯을 래핑하는 가벼운 플러터 패키지입니다. 긴 목록이나 스크롤 뷰의 맨 위로 돌아가는 직관적인 방법을 제공하여 사용자 경험을 향상시킵니다. 이 패키지는 ListView, CustomScrollView 또는 SingleChildScrollView와 같은 모든 스크롤 가능한 콘텐츠와 원활하게 작동하며, 버튼의 외관과 동작을 사용자 정의할 수 있습니다.
사용 사례
긴 목록에 위로 스크롤 버튼 추가하기
스크롤 가능한 대시보드에서 UX 개선
콘텐츠가 많은 앱에서 접근성 향상
스크롤 중 시각적 피드백 제공
중첩 스크롤 뷰 내 탐색 간소화
주요 기능
스크롤 위치에 기반한 자동 표시
사용자 정의 가능한 플로팅 액션 버튼
라퍼 위젯을 사용한 최소 설정
모든 스크롤 가능한 위젯과 호환됩니다
다크 모드 및 테마 통합을 지원합니다
적합한 대상
긴 스크롤 가능한 콘텐츠를 가진 앱
UX를 우선시하는 사용자 인터페이스 디자이너
빠른 스크롤 상단 이동 구현을 찾는 개발자
최소 종속성 요구 프로젝트
콘텐츠가 풍부한 화면을 갖춘 모바일 앱
고려 사항
추가 구성 없이 복잡한 중첩 스크롤 뷰와 함께 작동하지 않을 수 있습니다
기본값을 사용하지 않는 경우 수동으로 스크롤 컨트롤러를 처리해야 합니다
기본 스타일 외에 사용자 지정 옵션이 제한적입니다
스크롤이 불가능한 위젯에는 적합하지 않습니다
플랫폼별 스크롤 동작에 의존합니다
원본 README
연결된 소스 저장소의 README 원문 스냅샷입니다. 최신 내용은 저장소에서 확인하세요.
flutter_scroll_to_top
A wrapper to show a scroll to top prompt to the user on ScrollView widgets.
Installing
Add the following dependency to your pubspec.yaml file:
If the child ScrollView has different properties for scrollController, scrollDirection,
primary or reverse parameters than the default values, you need to pass them to the ScrollWrapper
widget as it requires the same parameters. It provides a ScrollViewProperties object in the builder
callback that you can use to access the properties in the ScrollView widget.
You can pass the following parameters to customise the prompt accordingly
enabledAtOffset - At what scroll offset to enable the prompt on.
alwaysVisibleAtOffset - If the prompt is to be always visible at the provided offset. Setting this to false only shows the prompt when the user starts scrolling upwards. Default value is false.
scrollOffsetUntilVisible - Offset should the user scroll in the opposite direction before the prompt becomes visible.
scrollOffsetUntilHide - Offset should the user scroll before the prompt hides itself, if visible.
promptAlignment - Where on the widget to align the prompt.
promptDuration - Duration it takes for the prompt to come into view/vanish.
promptAnimationCurve - Animation Curve that the prompt will follow when coming into view.
promptAnimationType - PromptAnimation that the prompt follows when animating. Has three options, fade, scale and size.
scrollToTopDuration - Duration it takes for the page to scroll to the top on prompt button press.
scrollToTopCurve - Animation Curve for scrolling to the top.
promptTheme - You can pass PromptButtonTheme to modify the prompt button further. It has the following parameters:
padding - Padding around the prompt button.
iconPadding - Padding around the icon inside the button.