mirror of
https://github.com/zjs81/meshcore-open.git
synced 2026-07-02 15:10:36 +10:00
Replace action buttons with a popup menu for better UI/UX on channels and map screens
This commit is contained in:
@@ -121,24 +121,44 @@ class _ChannelsScreenState extends State<ChannelsScreen>
|
|||||||
centerTitle: true,
|
centerTitle: true,
|
||||||
automaticallyImplyLeading: false,
|
automaticallyImplyLeading: false,
|
||||||
actions: [
|
actions: [
|
||||||
if (_communities.isNotEmpty)
|
PopupMenuButton(
|
||||||
IconButton(
|
itemBuilder: (context) => [
|
||||||
icon: const Icon(Icons.groups),
|
PopupMenuItem(
|
||||||
tooltip: context.l10n.community_manageCommunities,
|
child: Row(
|
||||||
onPressed: () => _showManageCommunitiesDialog(context),
|
children: [
|
||||||
),
|
const Icon(Icons.logout, color: Colors.red),
|
||||||
IconButton(
|
const SizedBox(width: 8),
|
||||||
icon: const Icon(Icons.bluetooth_disabled),
|
Text(context.l10n.common_disconnect),
|
||||||
tooltip: context.l10n.common_disconnect,
|
],
|
||||||
onPressed: () => _disconnect(context),
|
),
|
||||||
),
|
onTap: () => _disconnect(context),
|
||||||
IconButton(
|
),
|
||||||
icon: const Icon(Icons.tune),
|
if (_communities.isNotEmpty)
|
||||||
tooltip: context.l10n.common_settings,
|
PopupMenuItem(
|
||||||
onPressed: () => Navigator.push(
|
child: Row(
|
||||||
context,
|
children: [
|
||||||
MaterialPageRoute(builder: (context) => const SettingsScreen()),
|
const Icon(Icons.groups),
|
||||||
),
|
const SizedBox(width: 8),
|
||||||
|
Text(context.l10n.community_manageCommunities),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
onTap: () => _showManageCommunitiesDialog(context),
|
||||||
|
),
|
||||||
|
PopupMenuItem(
|
||||||
|
child: Row(
|
||||||
|
children: [
|
||||||
|
const Icon(Icons.settings),
|
||||||
|
const SizedBox(width: 8),
|
||||||
|
Text(context.l10n.settings_title),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
onTap: () => Navigator.push(
|
||||||
|
context,
|
||||||
|
MaterialPageRoute(builder: (context) => const SettingsScreen()),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
icon: const Icon(Icons.more_vert),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|||||||
+26
-13
@@ -245,20 +245,33 @@ class _MapScreenState extends State<MapScreen> {
|
|||||||
centerTitle: true,
|
centerTitle: true,
|
||||||
automaticallyImplyLeading: false,
|
automaticallyImplyLeading: false,
|
||||||
actions: [
|
actions: [
|
||||||
IconButton(
|
PopupMenuButton(
|
||||||
icon: const Icon(Icons.bluetooth_disabled),
|
itemBuilder: (context) => [
|
||||||
tooltip: context.l10n.common_disconnect,
|
PopupMenuItem(
|
||||||
onPressed: () => _disconnect(context, connector),
|
child: Row(
|
||||||
),
|
children: [
|
||||||
IconButton(
|
const Icon(Icons.logout, color: Colors.red),
|
||||||
icon: const Icon(Icons.tune),
|
const SizedBox(width: 8),
|
||||||
tooltip: context.l10n.common_settings,
|
Text(context.l10n.common_disconnect),
|
||||||
onPressed: () => Navigator.push(
|
],
|
||||||
context,
|
),
|
||||||
MaterialPageRoute(
|
onTap: () => _disconnect(context, connector),
|
||||||
builder: (context) => const SettingsScreen(),
|
|
||||||
),
|
),
|
||||||
),
|
PopupMenuItem(
|
||||||
|
child: Row(
|
||||||
|
children: [
|
||||||
|
const Icon(Icons.settings),
|
||||||
|
const SizedBox(width: 8),
|
||||||
|
Text(context.l10n.settings_title),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
onTap: () => Navigator.push(
|
||||||
|
context,
|
||||||
|
MaterialPageRoute(builder: (context) => const SettingsScreen()),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
icon: const Icon(Icons.more_vert),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|||||||
Reference in New Issue
Block a user