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
+32 -12
View File
@@ -121,26 +121,46 @@ class _ChannelsScreenState extends State<ChannelsScreen>
centerTitle: true, centerTitle: true,
automaticallyImplyLeading: false, automaticallyImplyLeading: false,
actions: [ actions: [
PopupMenuButton(
itemBuilder: (context) => [
PopupMenuItem(
child: Row(
children: [
const Icon(Icons.logout, color: Colors.red),
const SizedBox(width: 8),
Text(context.l10n.common_disconnect),
],
),
onTap: () => _disconnect(context),
),
if (_communities.isNotEmpty) if (_communities.isNotEmpty)
IconButton( PopupMenuItem(
icon: const Icon(Icons.groups), child: Row(
tooltip: context.l10n.community_manageCommunities, children: [
onPressed: () => _showManageCommunitiesDialog(context), const Icon(Icons.groups),
const SizedBox(width: 8),
Text(context.l10n.community_manageCommunities),
],
), ),
IconButton( onTap: () => _showManageCommunitiesDialog(context),
icon: const Icon(Icons.bluetooth_disabled),
tooltip: context.l10n.common_disconnect,
onPressed: () => _disconnect(context),
), ),
IconButton( PopupMenuItem(
icon: const Icon(Icons.tune), child: Row(
tooltip: context.l10n.common_settings, children: [
onPressed: () => Navigator.push( const Icon(Icons.settings),
const SizedBox(width: 8),
Text(context.l10n.settings_title),
],
),
onTap: () => Navigator.push(
context, context,
MaterialPageRoute(builder: (context) => const SettingsScreen()), MaterialPageRoute(builder: (context) => const SettingsScreen()),
), ),
), ),
], ],
icon: const Icon(Icons.more_vert),
),
],
), ),
body: RefreshIndicator( body: RefreshIndicator(
onRefresh: () async { onRefresh: () async {
+23 -10
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: [
const Icon(Icons.logout, color: Colors.red),
const SizedBox(width: 8),
Text(context.l10n.common_disconnect),
],
), ),
IconButton( onTap: () => _disconnect(context, connector),
icon: const Icon(Icons.tune), ),
tooltip: context.l10n.common_settings, PopupMenuItem(
onPressed: () => Navigator.push( child: Row(
children: [
const Icon(Icons.settings),
const SizedBox(width: 8),
Text(context.l10n.settings_title),
],
),
onTap: () => Navigator.push(
context, context,
MaterialPageRoute( MaterialPageRoute(builder: (context) => const SettingsScreen()),
builder: (context) => const SettingsScreen(),
), ),
), ),
],
icon: const Icon(Icons.more_vert),
), ),
], ],
), ),