搜尋套件、儲存庫與 APP 分類

fab_circular_menu_plus 封面
套件詳情v0.0.4

fab_circular_menu_plus

一個用於使用浮動操作按鈕建立精美圓形菜單的 Flutter 套件。

AndroidiOSWebmacOSWindowsLinux
近 30 天下載
571
喜歡數
56
Pub 分數
160

安裝套件

flutter pub add fab_circular_menu_plus

套件介紹

根據套件公開資料產生的選型評估,僅供參考。

一個 Flutter 套件,可實現以浮動操作按鈕(FAB)為中心的優雅圓形選單。它提供流暢的動畫和可自訂的選單項目選項,非常適合增強行動與網頁應用中的使用者互動體驗。此套件支援 Android、iOS、Web、macOS、Windows 與 Linux 多個平台,確保在不同裝置上行為一致。透過直覺的設定與響應式設計,簡化基於 FAB 的互動導航實作。

適用情境

  • 在移動應用中新增互動式浮動操作按鈕選單
  • 透過動畫圓形操作面板增強使用者介面
  • 建立情境相關的快速操作介面
  • 在網頁應用中實現手勢驅動的導航
  • 設計可存取的觸控友善控制項

主要特色

  • 菜單展開的平滑圓形動畫
  • 可自定義的選單項目佈局和樣式
  • 對多個平台目標的支援
  • 與現有 FAB 組件輕鬆整合
  • 可設定的觸發手勢和時間

適合對象

  • 開發功能豐富的移動UI的開發者
  • 尋求動態 FAB 互動的設計師
  • 針對跨平台一致性的團隊
  • 需要直覺式手勢導航的應用程式
  • 強調視覺美感和使用者參與度的專案

使用建議

  • 在低階設備上可能需要效能調校
  • 對複雜選單行為的自訂功能有限
  • 依賴於 Flutter 手勢系統的穩定性
  • 不適合密集的選單結構
  • 最適合中等數量的選單項目(4-8 個)

原始 README

以下為關聯原始碼儲存庫的 README 原文快照,最新內容請造訪原始碼儲存庫。

FAB Circular Menu

Pub package License Null safety Platform

A Flutter package to create a nice circular menu using a Floating Action Button.

Originally inspired by Mayur Kshirsagar's great FAB Microinteraction design. It is implemented as a Flutter plugin by Mariano Cordova (source code). This plugin is the continuation of the discontinued original plugin. I merged some of my bug fixes and made some changes to my liking.

I forked this plugin out of necessity and I have only a very limited time for maintenance, so PRs are highly welcome if any change is desired.

Showcase

Installation

Just add fab_circular_menu_plus to your pubspec.yml file

dependencies:
  fab_circular_menu_plus: ^0.0.1

Example

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        body: Placeholder(),
        floatingActionButton: FabCircularMenuPlus(
          children: <Widget>[
            IconButton(icon: Icon(Icons.home), onPressed: () {
              print('Home');
            }),
            IconButton(icon: Icon(Icons.favorite), onPressed: () {
              print('Favorite');
            })
          ]
        )
      )
    );
  }
}

You can check for a more complete example in the example directory.

Customize

You can customize the widget appearance using the following properties:

Property Description Default
alignment Sets the widget alignment Alignment.bottomRight
ringColor Sets the ring color accentColor
ringDiameterLimitFactor Sets the ring diameter limit factor 1.5
ringDiameter Sets the ring diameter screenWidth * ringDiameterLimitFactor (portrait)
screenHeight * ringDiameterLimitFactor (landscape)
ringWidthLimitFactor Sets the ring width limit factor 0.2
ringWidth Sets the ring width ringDiameter * ringWidthLimitFactor
fabSize Sets the FAB size 64.0
fabElevation Sets the elevation for the FAB 8.0
fabColor Sets the FAB color primaryColor
fabOpenColor Sets the FAB color while the menu is open. This property takes precedence over fabColor -
fabCloseColor Sets the FAB color while the menu is closed. This property takes precedence over fabColor -
fabChild Sets the child inside the FAB. This property takes precedence over fabOpenicon and fabCloseIcon -
fabOpenIcon Sets the FAB icon while the menu is open Icon(Icons.menu)
fabCloseIcon Sets the FAB icon while the menu is closed Icon(Icons.close)
fabMargin Sets the widget margin EdgeInsets.all(16.0)
animationDuration Changes the animation duration Duration(milliseconds: 800)
animationCurve Allows you to modify the animation curve Curves.easeInOutCirc
onDisplayChange This callback is called every time the menu is opened or closed, passing the current state as a parameter. -

Handling the menu programmatically

It is possible to handle the menu programmatically by using a key. Just create a key and set it in the key property of the FabCircularMenuPlus, then use the key to get the current state and open, close or check the status of the menu.

class MyApp extends StatelessWidget {
  final GlobalKey<FabCircularMenuPlusState> fabKey = GlobalKey();

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        body: RaisedButton(
          onPressed: () {
            if (fabKey.currentState.isOpen) {
              fabKey.currentState.close();
            } else {
              fabKey.currentState.open();
            }
          },
          child: Text('Toggle menu')
        ),
        floatingActionButton: FabCircularMenuPlus(
          key: fabKey,
          children: <Widget>[
            // ...
          ]
        )
      )
    );
  }
}

Contributing

I will be very happy if you contribute to this project, feel free to submit a PR.

所屬分類

依賴

依賴清單 1 項

原始碼儲存庫

使用此套件的專案