Replace action buttons with a popup menu for better UI/UX on channels and map screens

This commit is contained in:
Winston Lowe
2026-01-31 15:25:34 -08:00
parent 5115d8bbe3
commit 33680f0cb9
2 changed files with 64 additions and 31 deletions
+38 -18
View File
@@ -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
View File
@@ -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),
), ),
], ],
), ),