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

flutter_collapsing_toolbar 표지
패키지 상세v1.0.0

flutter_collapsing_toolbar

로맨틱한 접기 도구 모음 생성을 위한 플러터 패키지입니다. 귀하의 멋진 앱에 유용할 것입니다.

AndroidiOSWebmacOSWindowsLinux
30일 다운로드
163
좋아요
51
Pub 점수
150

패키지 설치

flutter pub add flutter_collapsing_toolbar

패키지 개요

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

로맨틱 스타일의 축소 가능한 도구 모음 생성을 가능하게 하는 플러터 패키지로, 앱 내비게이션을 동적이고 시각적으로 매력적인 헤더로 강화하는 데 이상적입니다. 사용자가 스크롤할 때 부드러운 전환을 지원하며, 스크롤 위치에 따라 콘텐츠를 표시하거나 숨깁니다. 현대적인 UI를 위해 설계되었으며, 안드로이드, iOS, 웹, 맥OS, 윈도우, 리눅스에서 몰입형 경험을 필요로 하는 앱에 원활하게 통합됩니다. 가볍고 최소한의 구성으로 쉽게 구현할 수 있습니다.

사용 사례

  • 몰입형 앱 헤더 만들기
  • 스크롤 기반 UI 전환 구현
  • 모바일 및 웹 앱의 미적 요소 향상
  • 아름다운 랜딩 페이지 디자인
  • 반응형 네비게이션 바 만들기

주요 기능

  • 부드러운 접기 애니메이션
  • 사용자 정의 가능한 헤더 동작
  • 크로스 플랫폼 호환성
  • 기존 위젯과의 간편한 통합
  • 스크롤 물리 효과 사용자 정의 지원

적합한 대상

  • 로맨틱 테마의 UI를 찾는 개발자
  • 풍부한 시각적 스토리텔링을 갖춘 앱
  • 콘텐츠 중심 애플리케이션
  • 디자인 중심의 플러터 프로젝트
  • 동적 헤더를 갖춘 모바일 및 웹 앱

고려 사항

  • ScrollController에 대한 이해가 필요합니다
  • 복잡한 중첩 콘텐츠와 함께 성능에 영향을 미칠 수 있습니다
  • 사용 가능한 문서가 제한되어 있습니다
  • 단일 스크롤 컨텍스트에 가장 적합
  • 간단한 탐색 레이아웃에 적합하지 않습니다

원본 README

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

Flutter Collapsing Toolbar

A Flutter package to create a Romantic Collapsing Toolbar. It will be useful for your awesome app. This widget is created to be able to standalone with any views, helps you able to add it into any complex ScrollView or ListView.

This is a present from Romantic Project. More from Romantic Developer

Demo

Example
import 'package:flutter/material.dart';
import 'package:flutter_collapsing_toolbar/flutter_collapsing_toolbar.dart';

void main() => runApp(MyApp());

const kSampleIcons = [
  Icons.track_changes_outlined,
  Icons.receipt_long_outlined,
  Icons.wifi_protected_setup_outlined,
  Icons.add_to_home_screen_outlined,
  Icons.account_box_outlined,
];
const kSampleIconLabels = [
  'Khuyến mãi',
  'Lịch sử',
  'Chuyển tiền',
  'Nạp tiền',
  'Tài khoản',
];

class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  final controller = ScrollController();
  double headerOffset = 0.0;

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Example',
      theme: ThemeData(
        primarySwatch: Colors.red,
      ),
      home: Scaffold(
        body: Container(
          margin: const EdgeInsets.only(top: 24.0),
          child: Column(
            children: [
              Align(
                alignment: Alignment.topCenter,
                child: CollapsingToolbar(
                  controller: controller,
                  expandedHeight: 160,
                  collapsedHeight: 64,
                  decorationForegroundColor: Color(0xffd90000),
                  decorationBackgroundColor: Colors.white,
                  onCollapsing: (double offset) {
                    setState(() {
                      headerOffset = offset;
                    });
                  },
                  leading: Container(
                    margin: EdgeInsets.only(left: 12),
                    padding: EdgeInsets.all(4),
                    decoration: ShapeDecoration(
                      color: Colors.white,
                      shape: CircleBorder(),
                    ),
                    child: Icon(
                      Icons.person,
                      size: 24,
                      color: Colors.black38,
                    ),
                  ),
                  title: Text(
                    'Romantic Developer',
                    style: TextStyle(
                      fontSize: 16,
                      color: Colors.white,
                      fontWeight: FontWeight.w600,
                    ),
                  ),
                  actions: [
                    ElevatedButton(
                      onPressed: () {},
                      style: ButtonStyle(
                        shape: MaterialStateProperty.all(CircleBorder()),
                        backgroundColor:
                            MaterialStateProperty.all(Colors.transparent),
                        elevation: MaterialStateProperty.all(0.0),
                      ),
                      child: Padding(
                        padding: const EdgeInsets.all(8.0),
                        child: Icon(
                          Icons.search,
                          color: Colors.white,
                          size: 24,
                        ),
                      ),
                    ),
                  ],
                  featureCount: 5,
                  featureIconBuilder: (context, index) {
                    return Icon(
                      kSampleIcons[index],
                      size: 54,
                      color: Colors.white,
                    );
                  },
                  featureLabelBuilder: (context, index) {
                    return Text(
                      kSampleIconLabels[index],
                      textAlign: TextAlign.center,
                      maxLines: 1,
                      style: TextStyle(
                        fontSize: 12,
                        color: Colors.white,
                      ),
                    );
                  },
                  featureOnPressed: (context, index) {},
                ),
              ),
              Expanded(
                child: Container(
                  color: Colors.white,
                  child: SingleChildScrollView(
                    controller: controller,
                    child: Column(
                      children: [
                        Container(
                          height: headerOffset,
                        ),
                        Image.asset('assets/sample.jpg'),
                        Container(
                          height: 350,
                          color: Colors.white,
                        ),
                      ],
                    ),
                  ),
                ),
              ),
            ],
          ),
        ),
      ),
    );
  }
}

Development environment
[✓] Flutter (Channel stable, 2.0.5, on macOS 11.2.3 20D91 darwin-x64, locale en-VN)
    • Flutter version 2.0.5
    • Framework revision adc687823a (11 days ago), 2021-04-16 09:40:20 -0700
    • Engine revision b09f014e96
    • Dart version 2.12.3

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
    • Platform android-30, build-tools 30.0.3
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS
    • Xcode at /Applications/Xcode_12.app/Contents/Developer
    • Xcode 12.4, Build version 12D4e
    • CocoaPods version 1.10.1

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 4.1)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495)

카테고리

소스 저장소

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

아직 데이터가 없습니다.