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

插件详情v1.0.5

adv_fab

一个浮动操作按钮,可以展开自身以显示其隐藏的控件。它也可以用作导航栏或浮动空间栏。

近 30 天下载
83
喜欢数
125
Pub 分数
40

安装插件

flutter pub add adv_fab

插件介绍

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

adv_fab 是一个 Flutter 包,通过使标准的浮动操作按钮能够展开并显示隐藏的小部件,从而增强其功能,提供动态交互体验。它支持用作可自定义的 NavigationBar 或浮动空间栏,非常适合需要直观导航和视觉层次感的现代 UI 设计。该包轻量级,可轻松集成到现有的 Flutter 项目中,设置简单。其可展开行为可提升移动应用中的可访问性和用户参与度。

适合场景

  • 底部导航栏,带可展开操作
  • 仪表板中的增强型浮动操作按钮
  • 交互式应用工具栏
  • 可自定义的导航栏
  • 可滚动布局中的浮动空间条

主要特点

  • 可展开的浮动操作按钮,带有平滑动画
  • 支持多个子 Widget
  • 可重用于 NavigationBar 或 floatingSpaceBar
  • 轻量级且易于集成
  • 可配置的展开方向和时序

适合对象

  • 开发交互式 Flutter 应用的开发者
  • 寻求现代UI模式的设计师
  • 需要可访问浮动控件的应用
  • 具有复杂底部导航需求的项目
  • 具有动态布局的UI密集型应用程序

使用建议

  • 可能需要仔细的布局管理
  • 动画性能取决于设备
  • 有限的平台特定自定义
  • 不适用于简单的静态悬浮操作按钮(FAB)
  • 最好与清晰的视觉层次结构配合使用

原始 README

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

AdvFAB (More Than Just A Floating Action Button)

AdvFAB is An Advanced floating action button that expands itself to reveal its hidden widget. It can also be used as an AnimatedbottomNavigationbar or just an AnimatedFloatingActionBar with the same expansion capabilities. Have a look at the gif below

Image 1 Image 2
demo image 1 domo image 2

NOTE: This package has lots of functionalities and parameters to customize your AdvFab please refer to the example floder and the full documentation in order to take advantage of this package to the fullest. Use this quick guide to setup your work environment and understand the basics :)

Important links

Create an Advanced FLoating Action Button (AdvFab)

  • First import the package inside your project
import 'package:adv_fab/adv_fab.dart';
  • In your project, create a AdvFabController
AdvFabController controller;
//now inside the inti function
@override
  void initState() {
    super.initState();
    controller = AdvFabController();
  }

This controller will allow you to expand, collapse and more importantly "setExpandedWidgetConfiguration". It will also give you the state of the AdvFab( true or false depending on whether the widget is expanded or not)

IMPORTANT : The "setExpandedWidgetConfiguration" shall be called at least once in the life time of your widget, to configure what has to be displayed once the AdvFab is expanded else you will get an error.

  • Create an AdvFab widget inside the floatingActionButton of the scaffold
Scaffold(
	floatingActionButton: AdvFab(
		//controller shall not be null (actually it can but still....)
		controller: controller
	),
)

Use flags

AdvFab allows you to create a navigation bar, an empty bar (where you can add a ny widget you want) or just a normal floating action button. To enable these functionalities, here are the flags to toggle

  • useAsFloatingSpaceBar: false (by default )
  • useAsFloatingActionButton: true ( by default )
  • useAsNavigationBar: false (by default )

IMPORTANT : There can be only one value as "true", if you set more than one value as true, then a priority rule will be applied and will set the flag with higher priority to true and you will get a configuration error warning

Important Note

  • In order to maintain the screen adaptability of this widget (to make it look even on all screens), I opted for a formula based on percentages of the screen. This means that every width and height shall be given by you in the range [0 - 100],100 inclusive. Example:
AdvFab(
   useFloatingSpaceBar: true,
   floatingSpaceBarContainerWidth: 90,
),
  • To help you debug your code easily, I included a log facility, You just have to set the ShowLogs property to true and you will get all of them.

  • When you use AdvFab as a floating Action Button, the default Icon displayed will be a warning icon in red, just use the floatingActionButtonIconColor and floatingActionButtonIcon properties to change them; The floating action button also has its idenpendent ontap property called onFloatingActionButtonTapped

  • To use the AnimatedBottomNavigationBar, the body of the scaffold shall be a AdvBottomBarBody

Conclusion

Thank you for using my package, if you have any question feel free to contact me on instagram or directly on my mail emile@emilecode.com

Here are my other packages

所属分类

源码仓库

使用此插件的项目

暂无相关数据。