분류, 패키지 및 저장소 검색

adaptive_scrollbar 표지
패키지 상세v2.1.2

adaptive_scrollbar

화면의 어느 쪽에도 배치할 수 있는 적응형 데스크톱 스타일 스크롤바입니다.

AndroidiOSWebmacOSWindowsLinux
30일 다운로드
2.7천
좋아요
40
Pub 점수
130

패키지 설치

flutter pub add adaptive_scrollbar

패키지 개요

공개 정보를 바탕으로 생성한 선택 가이드입니다.

적응형 스크롤바는 플랫폼과 컨텍스트에 따라 자동으로 위치와 외관을 조정하는 데스크톱 스타일의 스크롤바를 제공하는 플러터 패키지입니다. 스크롤 가능한 위젯의 왼쪽 또는 오른쪽에 배치할 수 있으며, 다양한 기기 간에 일관된 사용자 경험을 제공합니다. 현대적인 UI를 위해 설계되었으며, 터치 및 비터치 인터페이스 모두에서 사용성을 향상시킵니다. 다양한 화면 크기와 입력 방식에 적응하여 모바일, 웹, 데스크톱 등 여러 플랫폼을 대상으로 하는 애플리케이션에 이상적입니다.

사용 사례

  • 스크롤 가능한 콘텐츠를 갖춘 크로스 플랫폼 앱
  • 모바일에서 데스크톱과 유사한 경험
  • 긴 목록에 대한 향상된 접근성
  • 사용자 정의 가능한 스크롤 표시기
  • 웹 및 데스크톱에서 반응형 UI

주요 기능

  • 왼쪽 또는 오른쪽으로 자동 위치 지정
  • 플랫폼 인식 디자인
  • 터치 및 비터치 장치를 지원합니다
  • 사용자 정의 가능한 외관
  • ScrollView와의 원활한 통합

적합한 대상

  • 다중 플랫폼 앱을 대상으로 하는 개발자
  • 데스크톱 스타일의 UI를 원하는 디자이너
  • 접근 가능한 스크롤이 필요한 앱
  • 긴 형식 콘텐츠를 포함한 프로젝트
  • 웹 및 데스크톱 중심의 Flutter 애플리케이션

고려 사항

  • 사용자 정의 테마를 위해 추가 스타일링이 필요할 수 있습니다
  • 매우 큰 목록에 대한 성능 영향
  • 기본 위치 설정을 초과한 사용자 정의는 제한되어 있습니다
  • 미니멀리스트 디자인에 적합하지 않음
  • 복잡한 레이아웃에서 신중한 배치가 필요합니다

원본 README

연결된 소스 저장소의 README 원문 스냅샷입니다. 최신 내용은 저장소에서 확인하세요.

adaptive_scrollbar

platform pub package GitHub stars GitHub forks GitHub license GitHub issues

Language: English

Adaptive Scrollbar is a library that allows you to create one or more desktop-style scrollbars on a single screen, each of which is bound only to its own object and placed in its own place on the screen.

How to use it

Just wrap with AdaptiveScrollbar your widget that contains your ScrollView object and specify the controller that is attached to this ScrollView object.

AdaptiveScrollbar(
  controller: controller,
  child: Center(
    child: ListView.builder(
      controller: controller,
      itemBuilder: (context, index) { 
        return Text(
            "Line " + index.toString());
      },
      itemCount: 50,
    ))),

pic

Multiple scrollbars

You can add multiple scrollbars to the screen at once. The controller is a required parameter in order to track changes to only one object if there are several ScrollView objects in your widget.

return AdaptiveScrollbar(
  controller: verticalScroll,
  width: verticalWidth,
  child: AdaptiveScrollbar(
    controller: horizontalScroll,
    width: horizontalWidth,
    position: ScrollbarPosition.bottom,
    underSpacing: EdgeInsets.only(bottom: verticalWidth),
    child: SingleChildScrollView(
      controller: horizontalScroll,
      scrollDirection: Axis.horizontal,
      child: Container(
        width: 2000,
        child: Container(
          color: Colors.lightBlueAccent,
          child: ListView.builder(
            controller: verticalScroll,
            itemCount: 30,
            itemBuilder: (context, index) {
              return Container(
                height: 30,
                child: Text("Line " + index.toString()));
            }))),
    )));

pic

Customization

You can position your scrollbar on any of the 4 sides of the screen. There is only one thing - if you choose ScrollbarPosition.top or ScrollbarPosition.bottom, your scrollbar will actually be rotated 90 degrees, and the top will be on the left. Do not forget about this if you specify the spacings for slider and under the slider part. I'll think about how to simplify this.

AdaptiveScrollbar(
  controller: verticalScroll,
  width: verticalWidth,
  child: AdaptiveScrollbar(
    controller: horizontalScroll,
    position: ScrollbarPosition.bottom,
    
    //the horizontal scrollbar will have a padding
    // on the RIGHT by the width of the vertical scrollbar
    underSpacing: EdgeInsets.only(bottom: verticalWidth),
    
    width: horizontalWidth,
    child: ...
),

pic

To set slider width, you can set the horizontal sliderSpacing. The vertical sliderSpacing will determine the padding of the slider from the start and the end of the bottom. The height of the slider is determined automatically based on the size of the ScrollView object. If ScrollView object has nowhere to scroll, the scrollbar will not be displayed on the screen.

You can set colors for slider and under the slider part, or completely set the decorations for them.

Slider scroll-to-click speed

You can set your own speed parameters for moving the slider in the direction of the click. scrollToClickDelta is the distance that the slider will move in one move. scrollToClickFirstDelay is the duration of the first delay between the slider moves in the direction of the click, in milliseconds. scrollToClickOtherDelay is the duration of the remaining delays between scrolls in the click direction, in milliseconds.

AdaptiveScrollbar(
  ...
  scrollToClickDelta: 75,
  scrollToClickFirstDelay: 200,
  scrollToClickOtherDelay: 50,
  ...
),

Parameters

Parameter Description Type Default value
child Widget that contains your ScrollView. Widget required
controller Controller that attached to ScrollView object. ScrollController required
position Position of scrollbar on the screen. ScrollbarPosition (enum) ScrollbarPosition.right
width Width of all scrollBar. double 16.0
sliderHeight Height of slider. If you set this value, there will be this height. If not set, the height will be calculated based on the content, as usual. double Calculated based on content
sliderChild Child widget for slider. Widget? -
underColor Under the slider part of the scrollbar color. Color Colors.white
sliderDefaultColor Default slider color. Color Colors.blueGrey
sliderActiveColor Active slider color. Color sliderDefaultColor.withRed(10)
underDecoration Under the slider part of the scrollbar decoration. BoxDecoration BoxDecoration(shape: BoxShape.rectangle, color: underColor)
sliderDecoration Slider decoration. BoxDecoration BoxDecoration(shape: BoxShape.rectangle, color: sliderDefaultColor)
sliderActiveDecoration Slider decoration during pressing. BoxDecoration BoxDecoration(shape: BoxShape.rectangle, color: sliderActiveColor)
scrollToClickDelta Offset of the slider in the direction of the click. double 100.0
scrollToClickFirstDelay Duration of the first delay between scrolls in the click direction, in milliseconds. int 400
scrollToClickOtherDelay Duration of the others delays between scrolls in the click direction, in milliseconds. int 100
underSpacing Under the slider part of the scrollbar spacing. Don't forget about rotation that depends on position. EdgeInsetsGeometry const EdgeInsets.all(0.0)
sliderSpacing Slider spacing from bottom. Don't forget about rotation that depends on position. EdgeInsetsGeometry const EdgeInsets.all(2.0)

카테고리

의존성

의존성 목록 2 개

소스 저장소

이 패키지를 사용하는 프로젝트

아직 데이터가 없습니다.