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

套件詳情v0.0.6

popup_menu_plus

一個完全以 Dart 編寫的 Flutter 氣泡式選單元件,支援 iOS 與 Android。

AndroidiOSWebmacOSWindowsLinux
近 30 天下載
898
喜歡數
30
Pub 分數
150

安裝套件

flutter pub add popup_menu_plus

套件介紹

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

popup_menu_plus 是一個 Flutter 套件,提供可自訂的彈出式選單元件,完全以 Dart 實作。它在 iOS 與 Android 上提供類似原生的功能,並支援多個平台,包括 Web、macOS、Windows 與 Linux。此套件透過點擊或手勢觸發的上下文相關選單來提升使用者互動體驗。設計輕巧,易於整合,且與現代 Flutter 使用方式相容。開發者可透過自訂項目與樣式選項擴展其行為。

適用情境

  • 應用中的上下文操作
  • 使用者設定選單
  • 下拉式導航
  • 表單的可自定義彈窗
  • 平台一致的使用者介面元素

主要特色

  • 跨平台相容性
  • 完全用 Dart 編寫
  • 支援手勢觸發
  • 可擴展的物品自訂
  • 輕量且高效

適合對象

  • 開發跨平台應用的開發者
  • 需要一致菜單UI的團隊
  • 需要上下文操作選單的應用程式
  • 具有嚴格性能約束的項目
  • UI密集型應用

使用建議

  • 需要手動處理選單定位
  • 內建主題選項有限
  • 可能需要額外的邏輯來處理複雜互動
  • 未針對非常大的選單項目進行優化
  • 依賴於 Flutter 的觸控系統

原始 README

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

Popup Menu Plus

This project is a fork of chinabrant/popup_menu.

This project was written completely in dart, and it supports both iOS and Android.

Screenshots

Todo

  • [ ] show/hide animation

Usage

You can find the demo at the 'example' folder.

PopupMenu menu = PopupMenu(
      context: context,
      config: const MenuConfig(
        backgroundColor: Colors.green,
        lineColor: Colors.greenAccent,
        highlightColor: Colors.lightGreenAccent,
      ),
      items: [
        PopUpMenuItem(title: 'Copy', image: Image.asset('assets/copy.png')), 
        PopUpMenuItem(title: 'Home', image: Icon(Icons.home, color: Colors.white,)), 
        PopUpMenuItem(title: 'Mail', image: Icon(Icons.mail, color: Colors.white,)), 
        PopUpMenuItem(title: 'Power', image: Icon(Icons.power, color: Colors.white,)),
        PopUpMenuItem(title: 'Setting', image: Icon(Icons.settings, color: Colors.white,)), 
        PopUpMenuItem(title: 'Traffic', image: Icon(Icons.traffic, color: Colors.white,))], 
      onClickMenu: onClickMenu, 
      onShow: onShow,
      onDismiss: onDismiss);

menu.show(rect: rect);


or

PopupMenu menu = PopupMenu(
        context: context,
        config: const MenuConfig(
            backgroundColor: Colors.green,
            lineColor: Colors.greenAccent,
            highlightColor: Colors.lightGreenAccent,
        ),
        items: [
          PopUpMenuItem(title: 'Copy', image: Image.asset('assets/copy.png')),
          PopUpMenuItem(
              title: 'Home',
              textStyle: TextStyle(fontSize: 10.0, color: Colors.tealAccent),
              image: Icon(
                Icons.home,
                color: Colors.white,
              )),
          PopUpMenuItem(
              title: 'Mail',
              image: Icon(
                Icons.mail,
                color: Colors.white,
              )),
          PopUpMenuItem(
              title: 'Power',
              image: Icon(
                Icons.power,
                color: Colors.white,
              )),
          PopUpMenuItem(
              title: 'Setting',
              image: Icon(
                Icons.settings,
                color: Colors.white,
              )),
          PopUpMenuItem(
              title: 'PopupMenu',
              image: Icon(
                Icons.menu,
                color: Colors.white,
              ))
        ],
        onClickMenu: onClickMenu,
        onDismiss: onDismiss);
    menu.show(widgetKey: btnKey2);

with custom content:

PopupMenu menu = PopupMenu(
        context: context,
        config: const MenuConfig(
            type: MenuType.custom,
            itemHeight: 200,
            itemWidth: 200,
            backgroundColor: Colors.green,
        ),
        content: Container(
            width: 50,
            height: 50,
            color: Colors.red,
          ),
        onClickMenu: onClickMenu,
        onDismiss: onDismiss);
    menu.show(widgetKey: btnKey2);

所屬分類

原始碼儲存庫

使用此套件的專案

暫無相關資料。