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

패키지 상세v3.2.0

flutter_zoom_drawer

사용자 정의 사이드 메뉴(Drawer) 구현을 포함한 플러터 패키지

AndroidiOSWebmacOSWindowsLinux
30일 다운로드
5.1천
좋아요
1.1천
Pub 점수
150

패키지 설치

flutter pub add flutter_zoom_drawer

패키지 개요

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

Flutter Zoom Drawer는 Flutter 앱용으로 사용자 정의 가능한 사이드 메뉴(드로어) 구현체로 부드러운 줌 및 슬라이드 애니메이션을 제공합니다. 다양한 화면 크기와 플랫폼을 지원하며, 향상된 탐색 경험을 제공합니다. 개발자는 최소한의 설정으로 반응형 드로어를 쉽게 통합할 수 있으며, 현대적인 앱 인터페이스에 적합합니다. 직관적인 구성 옵션을 통해 수직 및 수평 드로어 레이아웃을 모두 지원하여 다양한 디자인 요구 사항에 적합합니다. 가벼운 성능 덕분에 Android, iOS, Web, macOS, Windows, Linux에서 원활한 작동이 가능합니다.

사용 사례

  • 모바일 앱 탐색
  • 웹 대시보드 레이아웃
  • 데스크톱 애플리케이션 메뉴
  • 사용자 지정 가능한 측면 패널
  • 인터랙티브 UI 컴포넌트

주요 기능

  • 부드러운 줌 및 슬라이드 애니메이션
  • 다중 플랫폼 지원
  • 사용자 정의 가능한 서랍 위치
  • 반응형 디자인 통합
  • 사용하기 쉬운 API

적합한 대상

  • 애니메이션 서랍을 찾는 개발자
  • 현대적인 탐색 패턴을 요구하는 앱
  • 크로스 플랫폼 애플리케이션
  • 유연한 드로어 옵션을 원하는 UI 디자이너
  • 복잡한 레이아웃 요구사항을 가진 프로젝트

고려 사항

  • 복잡한 테마에 대해 추가 스타일링이 필요할 수 있습니다
  • 고부하 콘텐츠를 사용할 때 저사양 기기의 성능 영향
  • 고급 제스처를 위한 제한된 내장 사용자 정의
  • 간단한 정적 서랍에는 적합하지 않습니다
  • 중첩된 네비게이터를 주의 깊게 다뤄야 합니다

원본 README

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

Flutter Zoom Drawer

pub package License: MIT

A Flutter package with custom implementation of the Side Menu (Drawer)

🌟 Getting Started

To start using this package, add flutter_zoom_drawer dependency to your pubspec.yaml

dependencies:
  flutter_zoom_drawer: "<latest_release>"

⚠ Version 3 Breaking Changes for Style

Old Style New Style
DrawerStyle.style1 DrawerStyle.defaultStyle
DrawerStyle.style2 DrawerStyle.defaultStyle
DrawerStyle.style3 DrawerStyle.defaultStyle
DrawerStyle.style4 DrawerStyle.style1
DrawerStyle.style5 DrawerStyle.style2
DrawerStyle.style6 DrawerStyle.style3
DrawerStyle.style7 DrawerStyle.style4

💪 Features

  • Simple sliding drawer
  • Sliding drawer with shadows
  • Sliding drawer with rotation
  • Sliding drawer with rotation and shadows
  • Support for both LTR & RTL

📌 Simple Example (Thanks to @JesusHdezWaterloo)

import 'package:flutter/material.dart';
import 'package:flutter_zoom_drawer/flutter_zoom_drawer.dart';
import 'package:get/get.dart';

void main() {
  Get.put<MyDrawerController>(MyDrawerController());

  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Zoom Drawer Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
        visualDensity: VisualDensity.adaptivePlatformDensity,
      ),
      home: MyHomePage(),
    );
  }
}

class MyHomePage extends GetView<MyDrawerController> {
  @override
  Widget build(BuildContext context) {
    return GetBuilder<MyDrawerController>(
      builder: (_) => ZoomDrawer(
        controller: _.zoomDrawerController,
        menuScreen: MenuScreen(),
        mainScreen: MainScreen(),
        borderRadius: 24.0,
        showShadow: true,
        angle: -12.0,
        drawerShadowsBackgroundColor: Colors.grey,
        slideWidth: MediaQuery.of(context).size.width * 0.65,
      ),
    );
  }
}

class MenuScreen extends GetView<MyDrawerController> {
  const MenuScreen({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Container(
      color: Colors.yellow,
    );
  }
}

class MainScreen extends GetView<MyDrawerController> {
  const MainScreen({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Container(
      color: Colors.pink,
      child: Center(
        child: ElevatedButton(
          onPressed: controller.toggleDrawer,
          child: Text("Toggle Drawer"),
        ),
      ),
    );
  }
}

class MyDrawerController extends GetxController {
  final zoomDrawerController = ZoomDrawerController();

  void toggleDrawer() {
    print("Toggle drawer");
    zoomDrawerController.toggle?.call();
    update();
  }
}

📝 Documentation

    ZoomDrawer(
      controller: ZoomDrawerController,
      style: DrawerStyle.defaultStyle,
      menuScreen: MenuScreen(),
      mainScreen: MainScreen(),
      borderRadius: 24.0,
      showShadow: true,
      angle: -12.0,
      drawerShadowsBackgroundColor: Colors.grey[300],
      slideWidth: MediaQuery.of(context).size.width*.65,
      openCurve: Curves.fastOutSlowIn,
      closeCurve: Curves.bounceIn,
    )
Parameters Value Required Docs
controller ZoomDrawerController No Controller to have access to the open/close/toggle function of the drawer
style DrawerStyle No the drawer style to be displayed (check the DrawerStyle enum)
mainScreen Widget Yes Screen containing the main content to display
menuScreen Widget Yes Screen containing the menu/bottom screen
slideWidth double No Sliding width of the drawer - defaults to 275.0
slideHeight double No Sliding height of the drawer - defaults to 0.0
mainScreenScale double No MainScreen scale - defaults to 0.3
borderRadius double No Border radius of the slided content - defaults to 16.0
angle double No Rotation angle of the drawer - defaults to -12.0 - should be 0.0 to -30.0
disableGesture bool No Disable the home page swipe to open drawer gesture - defaults to false
drawerShadowsBackgroundColor Color No Background color of the drawer shadows - defaults to white
showShadow bool No Boolean, whether to show the drawer shadows - defaults to false
openCurve Curve No open animation curve - defaults to Curves.easeOut
closeCurve Curve No close animation curve - defaults to Curves.easeOut
mainScreenTapClose bool No Close drawer when tapping mainScreen
mainScreenOverlayColor Color No Color of the main screen's cover overlay
overlayBlend BlendMode No The BlendMode of the mainScreenOverlayColor filter (default BlendMode.screen)
boxShadow BoxShadow No The Shadow of the mainScreenContent
overlayBlur double No The Blur amount of the mainScreen option
shrinkMainScreen bool No Shrinks the mainScreen by [slideWidth], good on desktop with Style2
drawerStyleBuilder DrawerStyleBuilder No Build custom animated style to override [DrawerStyle]

🕹️ Drawer Usage

To use the drawer, and be able to control it, there are 2 ways:

  • Using a ZoomDrawerController inside the main widget where you have the ZoomDrawer widget and providing it to the widget, which will allow you to trigger the open/close/toggle methods.
    final drawerController = ZoomDrawerController();

    drawerController.open();
    drawerController.close();
    drawerController.toggle();
    drawerController.isOpen();
    drawerController.stateNotifier;
  • Using the static method inside ancestor widgets to get access to the ZoomDrawer.
  ZoomDrawer.of(context).open();
  ZoomDrawer.of(context).close();
  ZoomDrawer.of(context).toggle();
  ZoomDrawer.of(context).isOpen();
  ZoomDrawer.of(context).stateNotifier;

Screens

Example app Demo

Example RTL Demo

  • Drawer Sliding
    ZoomDrawer(
      controller: ZoomDrawerController,
      menuScreen: MenuScreen(),
      mainScreen: MainScreen(),
      borderRadius: 24.0,
      showShadow: false,
      angle: 0.0,
      drawerShadowsBackgroundColor: Colors.grey[300],
      slideWidth: MediaQuery.of(context).size.width * 0.65,
    )

Drawer Sliding

  • Drawer Sliding with shadow
    ZoomDrawer(
      controller: ZoomDrawerController,
      menuScreen: MenuScreen(),
      mainScreen: MainScreen(),
      borderRadius: 24.0,
      showShadow: true,
      angle: 0.0,
      drawerShadowsBackgroundColor: Colors.grey[300],
      slideWidth: MediaQuery.of(context).size.width * 0.65,
    )

Drawer Sliding

  • Drawer Sliding with rotation
    ZoomDrawer(
      controller: ZoomDrawerController,
      menuScreen: MenuScreen(),
      mainScreen: MainScreen(),
      borderRadius: 24.0,
      showShadow: false,
      angle: -12.0,
      drawerShadowsBackgroundColor: Colors.grey[300],
      slideWidth: MediaQuery.of(context).size.width * 0.65,
    )

Drawer Sliding with rotation

  • Drawer Sliding with rotation and shadows
    ZoomDrawer(
      controller: ZoomDrawerController,
      menuScreen: MenuScreen(),
      mainScreen: MainScreen(),
      borderRadius: 24.0,
      showShadow: true,
      angle: -12.0,
      drawerShadowsBackgroundColor: Colors.grey[300],
      slideWidth: MediaQuery.of(context).size.width * 0.65,
    )

Drawer Sliding with rotation and shadows

Issues

Please file any issues, bugs or feature request as an issue on our GitHub page.

Want to contribute

If you would like to contribute to the plugin (e.g. by improving the documentation, solving a bug or adding a cool new feature), please carefully review our contribution guide and send us your pull request.

Credits

Credits goes to pedromassango as most of this package comes from his implementation.

카테고리

소스 저장소

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