v2.1.0popup_menu
一個 Flutter 氣泡式選單。使用純 Dart 編寫,支援 iOS 與 Android。
157喜歡 2440近 30 天下載135Pub 分數
AndroidiOSWebmacOSWindowsLinux
🔥一個Flutter彈出式選單。支援Pub。
以下為英文專案原文快照,最新內容請造訪 GitHub。
This project was written completely in dart, and it supports both iOS and Android.
You can find the demo at the 'example' folder.
First, you should set the context at somewhere in you code. Like below:
PopupMenu.context = context;
PopupMenu menu = PopupMenu(
items: [
MenuItem(title: 'Copy', image: Image.asset('assets/copy.png')),
MenuItem(title: 'Home', image: Icon(Icons.home, color: Colors.white,)),
MenuItem(title: 'Mail', image: Icon(Icons.mail, color: Colors.white,)),
MenuItem(title: 'Power', image: Icon(Icons.power, color: Colors.white,)),
MenuItem(title: 'Setting', image: Icon(Icons.settings, color: Colors.white,)),
MenuItem(title: 'Traffic', image: Icon(Icons.traffic, color: Colors.white,))],
onClickMenu: onClickMenu,
onShow: onShow,
onDismiss: onDismiss);
menu.show(rect: rect);
or
PopupMenu menu = PopupMenu(
backgroundColor: Colors.teal,
lineColor: Colors.tealAccent,
maxColumn: 3,
items: [
MenuItem(title: 'Copy', image: Image.asset('assets/copy.png')),
MenuItem(
title: 'Home',
textStyle: TextStyle(fontSize: 10.0, color: Colors.tealAccent),
image: Icon(
Icons.home,
color: Colors.white,
)),
MenuItem(
title: 'Mail',
image: Icon(
Icons.mail,
color: Colors.white,
)),
MenuItem(
title: 'Power',
image: Icon(
Icons.power,
color: Colors.white,
)),
MenuItem(
title: 'Setting',
image: Icon(
Icons.settings,
color: Colors.white,
)),
MenuItem(
title: 'PopupMenu',
image: Icon(
Icons.menu,
color: Colors.white,
))
],
onClickMenu: onClickMenu,
onDismiss: onDismiss);
menu.show(widgetKey: btnKey2);
依賴清單 2 項
{"sdk":"flutter"}{"sdk":"flutter"}先依使用情境篩選,再比較專案活躍情況,最後到原始儲存庫確認使用要求。
“A repository is the most basic element of GitHub.”
GitHub Docs — About repositories ↗