搜尋套件、儲存庫與 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

所屬分類

原始碼儲存庫

使用此套件的專案

暫無相關資料。