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

GitHub 저장소netglade/sliver_app_bar_builder

sliver_app_bar_builder

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

sliver_app_bar_builder 프로젝트 이미지
스타
19
포크
0
최근 푸시(UTC)
2026. 8. 25.
프로젝트 상태
활성

원본 README

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

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.

NetGlade GitHub avatar
GitHub 작성자

NetGlade ↗

Flutter & Web Apps enthusiasts

언어DartHTML

분류

이 저장소가 배포한 패키지

사용 중인 의존성

의존성 목록 4 개

  • flutter{"sdk":"flutter"}
  • flutter_test개발 의존성{"sdk":"flutter"}
  • melos개발 의존성^8.5.0
  • netglade_analysis개발 의존성^7.0.0

프로젝트에 맞는 저장소를 선택하려면?

사용 목적에 따라 검색하고 개발 활동을 비교한 뒤 원본 저장소에서 요구 사항을 확인하세요.

  1. 이름, 작성자 또는 설명으로 검색하고 기술 주제로 범위를 좁힙니다.
  2. 스타, 포크, 최근 푸시를 함께 비교하세요. 스타는 관심의 지표이며 품질을 보장하지 않습니다.
  3. 사용하기 전에 GitHub에서 README, 라이선스, Issues를 확인하세요.

출처 및 관리

“A repository is the most basic element of GitHub.”

GitHub Docs — About repositories ↗