FLUTTER ECOSYSTEM

santa112358/customizable_space_bar

스크롤 속도에 따라 콘텐츠가 변경되는 AppBar입니다. "대형 제목"을 구현할 수 있습니다.

사용자 정의 가능한 스페이스 바 프로젝트 이미지
Stars
18
Forks
2
최근 푸시(UTC)
2021. 3. 28.
프로젝트 상태
활성
Santa Takahashi GitHub avatar
GITHUB User

Santa Takahashi ↗

cat enthusiast

언어DartHTMLSwiftKotlinObjective-C

이 저장소가 배포한 패키지

사용 중인 의존성

의존성 목록 2 개
  • flutter{"sdk":"flutter"}
  • flutter_test개발 의존성{"sdk":"flutter"}

원본 README

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

README 펼치기 / 접기

customizable_space_bar

pub package License: MIT

AppBar which changes the content with scrolling rate. Enables to implement "Large Title"

13063567123474

Usage

This package is expected to be used with flexibleSpace: in SliverAppBar, which means you also need to use CustomScrollView.

    CustomScrollView(
        slivers: [
          SliverAppBar(
            pinned: true,
            leading: IconButton(icon: Icon(Icons.arrow_back_ios_sharp)),
            backgroundColor: Theme.of(context).scaffoldBackgroundColor,

            /// This is the part you use this package
            flexibleSpace: CustomizableSpaceBar(
              builder: (context, scrollingRate) {
                /// Example content
                return Padding(
                  padding: EdgeInsets.only(
                      bottom: 13, left: 12 + 40 * scrollingRate),
                  child: Align(
                    alignment: Alignment.bottomLeft,
                    child: Text(
                      "Hello World.",
                      style: TextStyle(
                          fontSize: 42 - 18 * scrollingRate,
                          fontWeight: FontWeight.bold),
                    ),
                  ),
                );
              },
            ),
            /// End of the part

            expandedHeight: 150,
          ),
          SliverList(
            delegate: SliverChildBuilderDelegate(
              (context, index) {
                return ListTile(
                  title: Text("LIST ITEM"),
                );
              },
            ),
          )
        ],
      ),

You can control the layout in the AppBar with scrollingRate.

When the shape is fully expanded, scrollingRate is 0.0. When the shape is collapsed to AppBar, it reaches to the limit 1.0.

13063658045969

If you have any requests or questions, please feel free to ask on github.