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

draggable_expandable_fab 封面
插件详情v1.0.0

draggable_expandable_fab

这个 Flutter 包提供了一个可展开和可拖动的浮动按钮,带有动画效果。

AndroidiOSWebmacOSWindowsLinux
近 30 天下载
96
喜欢数
27
Pub 分数
150

安装插件

flutter pub add draggable_expandable_fab

插件介绍

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

draggable_expandable_fab 包通过一个可展开为多个操作的浮动操作按钮,增强了 Flutter 应用的功能,并且可以拖动到屏幕上的任何位置。它具有平滑的展开和移动动画,提供交互性强且视觉效果吸引人的用户体验。适用于需要从单个按钮快速访问多个功能的应用程序,支持所有主要平台,包括移动设备、网页和桌面端。该按钮保持响应迅速且动作流畅,非常适合现代手势驱动的界面。

适合场景

  • 快速访问多个操作
  • 基于手势的导航
  • 交互式 UI 元素
  • 移动和桌面应用增强功能
  • 可自定义的操作菜单
  • 增强用户参与度

主要特点

  • 可拖动的浮动按钮
  • 可展开的操作菜单
  • 平滑的动画过渡
  • 跨平台支持
  • 可自定义布局
  • 响应式触摸处理

适合对象

  • 寻求交互式浮动操作按钮的应用开发者
  • 想要动态UI组件的设计人员
  • 需要丰富手势交互的项目
  • 移动应用中的多操作工具栏
  • 现代、动画化的应用界面

使用建议

  • 可能会影响低端设备的性能
  • 需要仔细放置以避免重叠
  • 超出基础样式的定制功能有限
  • 不太适合简单的单动作使用场景
  • 需要在所有目标平台上进行测试

原始 README

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

Expandable Draggable Fab

This Flutter package provides a Expandable and Draggable Floating Button with animation.

💻 Installation

In the dependencies: section of your pubspec.yaml, add the following line:

dependencies:
  draggable_expandable_fab: <latest version>

To use the latest changes:

  draggable_expandable_fab:
    git:
      url: https://github.com/Tughra/draggable_expandable_fab.git
      ref: master

❔ Usage

Import this class

import 'package:draggable_expandable_fab/draggable_expandable_fab.dart';

Replace Scaffold's parameters with these to better usage.

      floatingActionButtonAnimator: NoScalingAnimation(),
      floatingActionButtonLocation: ExpandableFloatLocation(),

Simple Implementation

Scaffold(
      floatingActionButtonAnimator: NoScalingAnimation(),
      floatingActionButtonLocation: ExpandableFloatLocation(),
      floatingActionButton: ExpandableDraggableFab(childrenCount: 3,
      distance: 100,// Animatiion distance during open and close. 
      children: [
        FloatingActionButton(onPressed: (){}),
        FloatingActionButton(onPressed: (){}),
        FloatingActionButton(onPressed: (){}),
      ],),
      body: Container(),
    );

Full Implementation

   final Size _size = MediaQuery.of(context).size;
    return Scaffold(
      floatingActionButtonAnimator: NoScalingAnimation(),
      floatingActionButtonLocation: ExpandableFloatLocation(),
      floatingActionButton: ExpandableDraggableFab(childrenCount: 3,
        onTab: (){
        debugPrint("Tab");
        },
        childrenTransition: ChildrenTransition.fadeTransation,
        initialOpen: false,
        childrenBoxDecoration: const BoxDecoration(color: Colors.red),
        enableChildrenAnimation: true,
        curveAnimation: Curves.linear,
        reverseAnimation: Curves.linear,
        childrenType: ChildrenType.columnChildren,
        closeChildrenRotate: false,
        childrenAlignment: Alignment.topRight,
        initialDraggableOffset: Offset(_size.width-90,_size.height-100),
      distance: 100,// Animation distance during open and close.
      children: [
        FloatingActionButton(onPressed: (){}),
        FloatingActionButton(onPressed: (){}),
        FloatingActionButton(onPressed: (){}),
      ],),
      body: Container(),
    );

所属分类

源码仓库

使用此插件的项目

暂无相关数据。