搜索插件、代码仓与 APP 分类

side_menu_animation 封面
插件详情v1.1.0

side_menu_animation

可自定义 UI 的动画侧边菜单。受 Yalantis 库(Android/iOS)启发。

AndroidiOSWebmacOSWindowsLinux
近 30 天下载
21
喜欢数
97
Pub 分数
150

安装插件

flutter pub add side_menu_animation

插件介绍

基于插件公开信息、社区数据与项目使用情况整理的选型参考。

一个 Flutter 包,提供可自定义 UI 的动画侧边菜单,灵感来自 Android 和 iOS 的 Yalantis 库。它提供了流畅的过渡效果和视觉特效,以增强跨多个平台的导航体验。该包支持外观和行为的完全自定义,非常适合需要现代、交互式抽屉的应用程序。它兼容 Android、iOS、Web、macOS、Windows 和 Linux,确保跨平台的一致性。

适合场景

  • 移动应用导航
  • Web仪表板界面
  • 跨平台应用程序
  • 可定制的抽屉设计
  • 交互式UI组件

主要特点

  • 流畅的动画过渡
  • 高度可定制的用户界面
  • 跨平台支持
  • 响应式设计
  • 与现有代码的轻松集成
  • 支持深色模式

适合对象

  • 开发移动或网页应用的开发者
  • 寻求现代导航模式的设计师
  • 需要动画侧边菜单的项目
  • 针对多个平台的应用
  • 使用 Flutter 进行全栈开发的团队

使用建议

  • 可能需要在旧设备上进行性能调优
  • 自定义选项可能会增加复杂性
  • 除了基本设置外,文档有限
  • 与其他导航包可能存在冲突
  • 未针对非常大的菜单项进行优化
  • 需要理解 Flutter 的动画系统

原始 README

以下为关联源码仓库的 README 原文快照,最新内容请访问源码仓库。

Side Menu Animation

pub package

Animated Side Menu with customizable UI. Inspired in Yalantis library (Android/iOS). Original Design: https://dribbble.com/shots/1689922-Side-Menu-Animation

Sample

SIDE MENU ANIMATION SIDE MENU ANIMATION - DRAG GESTURE

Learn how to build this package

  • Video 1: https://www.youtube.com/watch?v=vcdETKdI15E
  • Video 2: https://www.youtube.com/watch?v=W7mxTcwX5Wg

(Don't forget to subscribe and like)

Features

  • Optional parameter to tap outside to dismiss
  • Optional parameter to change the scrimColor
  • Custom color item for the side menu selected
  • Custom color item for the side menu unselected
  • Custom width for the side menu
  • Custom duration of the animation side menu
  • Display the menu from left or right

Getting Started

You should ensure that you add the router as a dependency in your flutter project.

dependencies:
 side_menu_animation: "^0.0.1"

You should then run flutter packages upgrade or update your packages in IntelliJ.

Example Project

There is a example project in the example folder. Check it out. Otherwise, keep reading to get up and running.

Usage

Need to include the import the package to the dart file where it will be used, use the below command,

import 'package:side_menu_animation/side_menu_animation.dart';

SideMenu

class SideMenuScreen extends StatelessWidget {
  final _index = ValueNotifier<int>(1);

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: SideMenuAnimation(
        appBarBuilder: (showMenu) => AppBar(
          leading: IconButton(icon: Icon(Icons.menu, color: Colors.black), onPressed: showMenu),
          backgroundColor: Theme.of(context).scaffoldBackgroundColor,
          elevation: 0,
          brightness: Brightness.light,
          centerTitle: true,
          title: ValueListenableBuilder<int>(
            valueListenable: _index,
            builder: (_, value, __) => Text(value.toString(), style: TextStyle(color: Colors.black)),
          ),
        ),
        views: [YourCustomViews1Here(), YourCustomViews2Here()],
        items: [MyCustomItem1Here(), MyCustomItem2Here()],
        selectedColor: Color(0xFFFF595E),
        unselectedColor: Color(0xFF1F2041),
        tapOutsideToDismiss: true,
        scrimColor: Colors.black45,
        onItemSelected: (value) {
          if (value > 0 && value != _index.value) _index.value = value;
        },
      ),
    );
  }
}

SideMenuBuilder

class SideMenuBuilderScreen extends StatelessWidget {
  final _index = ValueNotifier<int>(1);

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: SideMenuAnimation.builder(
        builder: (showMenu) {
          return Scaffold(
            appBar: AppBar(
              leading: IconButton(icon: Icon(Icons.menu, color: Colors.black), onPressed: showMenu),
              backgroundColor: Theme.of(context).scaffoldBackgroundColor,
              elevation: 0,
              brightness: Brightness.light,
              centerTitle: true,
              title: ValueListenableBuilder<int>(
                valueListenable: _index,
                builder: (_, value, __) => Text(_value.toString(), style: TextStyle(color: Colors.black)),
              ),
            ),
            body: ValueListenableBuilder<int>(
              valueListenable: _index,
              builder: (_, value, __) => IndexedStack(
                index: value - 1,
                children: [YourCustomViews1Here(), YourCustomViews2Here()],
              ),
            ),
          );
        },
       items: [MyCustomItem1Here(), MyCustomItem2Here()],
        selectedColor: Color(0xFFFF595E),
        unselectedColor: Color(0xFF1F2041),
        onItemSelected: (value) {
          if (value > 0 && value != _index.value) _index.value = value;
        },
      ),
    );
  }
}

For more info about the ussage, check the example project.

Contact

You can follow me on twitter @diegoveloper , Youtube channel

If you want to contribute with the project, just open a Pull request :), all contributions are welcome.

Contribution

If you want to contribute with this package, follow this steps:

  • Fork this repository.
  • Do your changes! You can add your name with link into the CONTRIBUTORS.md file.
  • Before push your changes run dartfmt . -w.
  • Create a Pull request on Github from your fork/branch to my repo(main branch).

所属分类

源码仓库

使用此插件的项目

暂无相关数据。