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

插件详情v2.0.0

flutter_speed_dial_material_design

用于实现 Material Design 速度拨号的 Flutter 插件(https://material.io/components/buttons-floating-action-button/#types-of-transitions)

近 30 天下载
46
喜欢数
62
Pub 分数
40

安装插件

flutter pub add flutter_speed_dial_material_design

插件介绍

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

一个 Flutter 插件,实现了 Material Design 速度拨号,即带有可展开菜单选项的浮动操作按钮。它遵循 Material Design 的过渡和交互指南,使用户能够从单个 FAB 访问多个操作。该包支持自定义图标、标签和动画样式,非常适合提升移动应用的用户界面效率。它可轻松集成到现有的 Flutter 项目中,设置简单。

适合场景

  • 在移动应用中添加快速访问操作菜单
  • 增强任务导向型界面中的导航
  • 通过 Material Design 标准提升 UI 一致性
  • 创建紧凑但功能丰富的浮动按钮
  • 在简洁的布局中简化对次要操作的访问

主要特点

  • 符合 Material Design 的动画
  • 可自定义的菜单项和图标
  • 对标签和工具提示的支持
  • 与现有 Flutter widget 的轻松集成
  • 可配置的展开方向和速度

适合对象

  • 开发 Material Design 应用的开发者
  • 需要快速操作访问的以用户界面为重点的应用程序
  • 致力于打造精致、现代界面的项目
  • 寻找可复用的 FAB 组件的移动应用开发者
  • 遵循 Google 设计指南的团队

使用建议

  • 有限的平台特定自定义
  • 可能需要额外的样式设置以适配非 Material 主题
  • 未针对非常大的菜单集进行优化
  • 动画性能在旧设备上可能有所不同
  • 无内置的键盘导航支持

原始 README

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

Flutter Speed dial of Material Design style

Flutter package which applies Material design Speed dial

Preview

There are several packages that provide fancy speed dial. However, as most of those do not work properly on docked FAB using notch, I referenced Andrea Bizzoto and Matt Carroll's idea/code specified here to make it work fine with notch as well. Truly appreciate to Andrea and Matt for sharing such an awesome idea and codes.

Usage

Basic usage
Widget build(BuildContext context) {
    return Scaffold(
      body: SafeArea(child: _buildBody()),
      floatingActionButton: _buildFloatingActionButton(),
      floatingActionButtonLocation: FloatingActionButtonLocation.endDocked,
      bottomNavigationBar: _buildBottomBar(),
    );
  }

Widget _buildFloatingActionButton() {
    final icons = [
      SpeedDialAction(child: Icon(Icons.mode_edit)),
      SpeedDialAction(child: Icon(Icons.date_range)),
      SpeedDialAction(child: Icon(Icons.list)),
    ];

    return SpeedDialFloatingActionButton(
      actions: icons,
      // Make sure one of child widget has Key value to have fade transition if widgets are same type.
      childOnFold: Icon(Icons.event_note, Key: UniqueKey()),
      childOnUnfold: Icon(Icons.add),
      useRotateAnimation: true,
      onAction: _onSpeedDialAction,
    );
  }
  
_onSpeedDialAction(int selectedActionIndex) {
  print('$selectedActionIndex Selected');
}
Using controller
SpeedDialController _controller = SpeedDialController();

SpeedDialFloatingActionButton(
      controller: _controller,
      ...
    );
    
// Use anywhere to mannually unfold
_controller.unfold();
Fade Transition animation between child widgets

In order to apply fade transition between [childOnFold] and [childOnUnfold], make sure one of those has Key field. (eg. ValueKey(value) or UniqueKey()). As we using AnimatedSwitcher for transition animation, no key with same type of child will perform no animation. It is AnimatedSwitcher's behaviour.

TO-DOs

  • [ ] Ability to display/hide speed dial when it is needed. (ex. hiding on scroll)
  • [X] Unfold function to force close the dial
  • [ ] Providing option for modal background with color parameter
  • [X] Text labels on each action widgets (Thanks to @CarlosHJuniior)

Contributing

Any pull requests for implementing To-Do functions are always welcome!

Other useful packages you might be instrested

Firebase Auth Simplify Google Maps Place Picker

Support

If the package was useful or saved your time, please do not hesitate to buy me a cup of coffee! ;)
The more caffeine I get, the more useful projects I can make in the future.

Buy Me A Coffee

所属分类

源码仓库

使用此插件的项目

暂无相关数据。