패키지, 저장소 및 앱 카테고리 검색

sliver_app_bar_builder 표지
패키지 상세v1.1.1

sliver_app_bar_builder

앱 바용으로 완전히 사용자 정의 가능한 슬리버이며, 빌더를 사용할 수 있는 장점이 있습니다.

AndroidiOSWebmacOSWindowsLinux
30일 다운로드
1.6만
좋아요
121
Pub 점수
160

패키지 설치

flutter pub add sliver_app_bar_builder

패키지 개요

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

빌더 패턴을 활용하여 동적 콘텐츠 생성을 지원하는 매우 사용자 정의 가능한 슬리버 앱 바입니다. 개발자가 레이아웃과 동작에 대해 세밀한 제어를 하여 복잡하고 반응성 있는 앱 바를 구축할 수 있도록 합니다. 스크롤 가능한 목록 내에서 사용하기 위해 특별히 설계되었으며, 부드러운 전환을 지원하고 플러터의 슬리버 시스템과 원활하게 통합됩니다. 스크롤 위치나 상태 변화에 따라 헤더가 적응하는 몰입형 스크롤 경험을 만들기에 이상적인 패키지입니다.

사용 사례

  • 스크롤 가능한 목록 내 사용자 지정 앱 바
  • 스크롤 위치에 기반한 동적 헤더 콘텐츠
  • 슬리버를 사용한 복잡한 UI 레이아웃
  • 모바일 및 웹을 위한 반응형 디자인
  • 앱 바에서 파라럭스 효과 구현하기
  • 인터랙티브 탐색 헤더 만들기

주요 기능

  • 빌더 기반 콘텐츠 생성
  • 슬리버 동작의 완전한 사용자 정의
  • 모든 주요 플랫폼을 지원합니다
  • ScrollView와의 원활한 통합
  • 스크롤 진행률에 적응 가능
  • 고급 UI 패턴을 위한 확장 가능

적합한 대상

  • 복잡한 스크롤 가능한 인터페이스를 구축하는 개발자
  • 유연한 헤더 컴포넌트가 필요한 디자이너
  • 동적 앱 바 동작을 필요로 하는 앱
  • 다양한 장치를 대상으로 하는 크로스 플랫폼 앱
  • 선언형 UI 패턴을 사용하는 팀

고려 사항

  • Flutter의 Sliver 시스템에 대한 이해가 필요합니다
  • 간단한 앱 바에 복잡성을 증가시킬 수 있습니다
  • 고급 UI 요구 사항에 가장 적합
  • 기본 정적 헤더에 권장되지 않음
  • 성능은 빌더 로직의 효율성에 달려 있습니다

원본 README

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

netglade

Developed with 💚 by netglade

ci pub package license: MIT style: netglade analysis Discord


A truly customizable sliver for app bars with the benefit of using builders. Check the storybook demo and play with it yourself.

SliverAppBarBuilder supports various configurations:

  • bar
    • height
    • initialHeight (when expanded)
    • background (for everything or bar only)
  • content
    • builder
    • initialHeight
    • toggle contentBelowBar (whether content is on top or below bar)
    • padding
  • leading and trailing actions
    • list of builders
    • toggle collapsing
    • padding
  • stretching
    • toggle stretch
    • stretchConfiguration
  • misc
    • pinned mode
    • toggle mode
    • toggle debug (so you can debug each part visually)

Getting Started

Using the package is simple. Just use the sliver SliverAppBarBuilder in place of SliverAppBar, configure all the properties, and enjoy.

Each builder, for content or leading/trailing actions, provides expand ratio and content/bar height, so you can easily use these values to customize your headers.

  • expandRatio is a value between 1.0 when expanded and 0.0 when shrunken
  • contentHeight/barHeight are current heights of corresponding parts

Content builder has additional property:

  • centerPadding, when contentBelowBar is false, is a value used to offset content to center it with bar

An example of a header with title moving from under back button to its right might look like this:

CustomScrollView(
  slivers: [
    SliverAppBarBuilder(
      barHeight: 60,
      pinned: true,
      leadingActions: [
        (context, expandRatio, barHeight, overlapsContent) {
          return SizedBox(
            height: barHeight,
            child: const BackButton(),
          );
        }
      ],
      initialContentHeight: 150,
      contentBuilder: (context, expandRatio, contentHeight, centerPadding, overlapsContent) {
        return Container(
          alignment: Alignment.centerLeft,
          height: 60,
          transform: Matrix4.translationValues(10 + (1 - expandRatio) * 40, 0, 0),
          child: Text(
            'My Title',
            style: TextStyle(
              fontSize: 22 + expandRatio * 10,
              color: Colors.white,
              fontWeight: FontWeight.bold,
            ),
          ),
        );
      },
    ),
  ],
);

Development

Flutter is pinned with FVM in .fvmrc (currently 3.41.5):

fvm install
fvm flutter pub get

The repository uses Melos as a task runner (the published package lives in the repository root, so the root itself is the only Melos package). Melos is configured with sdkPath: .fvm/flutter_sdk, so scripts always run against the pinned SDK:

fvm dart run melos run lint:all      # format check + flutter analyze + DCM
fvm dart run melos run lint:format   # dart format --set-exit-if-changed
fvm dart run melos run lint:dart     # flutter analyze
fvm dart run melos run lint:dcm      # dcm analyze
fvm dart run melos run format        # write formatting
fvm dart run melos run test          # flutter test

Run fvm dart run melos run --list to see all scripts. CI runs the very same commands; where FVM is not available, set MELOS_SDK_PATH=auto to run the scripts against the SDK on the PATH.

lint:dcm needs the DCM CLI on the PATH; the version used by CI is pinned in dcm_global.yaml.

카테고리

소스 저장소

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

아직 데이터가 없습니다.