From 0e53572589a04a017ff94a8a7bad9227c77fec28 Mon Sep 17 00:00:00 2001 From: flemming-it Date: Sat, 18 Jul 2026 00:08:51 +0200 Subject: [PATCH] fix(federation): primary action in the app bar and empty state, no FAB MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Every other page carries its primary action top right (New flow, Add store) — the lone Material FAB bottom right broke the pattern and sat far from the empty-state text asking for exactly that action. The empty state now offers the button in place too. Signed-off-by: flemming-it --- lib/pages/federation.dart | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/lib/pages/federation.dart b/lib/pages/federation.dart index a19a25c..fa5210d 100644 --- a/lib/pages/federation.dart +++ b/lib/pages/federation.dart @@ -93,6 +93,19 @@ class _FederationPageState extends State { appBar: AppBar( title: Text(l.federationTitle), actions: [ + // Primary action lives in the AppBar like every other + // page (Flows: "New flow", Store: "Add store") — no FAB. + Padding( + padding: const EdgeInsets.only(right: ChainSpace.sm), + child: OutlinedButton.icon( + icon: const Icon(Icons.add_link, size: 16), + label: Text(l.federationAddSatellite), + onPressed: _addSatellite, + style: OutlinedButton.styleFrom( + visualDensity: VisualDensity.compact, + ), + ), + ), IconButton( icon: const Icon(Icons.help_outline, size: 18), tooltip: l.helpTooltip, @@ -106,11 +119,6 @@ class _FederationPageState extends State { const SizedBox(width: ChainSpace.sm), ], ), - floatingActionButton: FloatingActionButton.extended( - onPressed: _addSatellite, - icon: const Icon(Icons.add_link), - label: Text(l.federationAddSatellite), - ), body: FutureBuilder>( future: _future, builder: (context, snapshot) { @@ -131,13 +139,14 @@ class _FederationPageState extends State { } final sats = snapshot.data ?? []; if (sats.isEmpty) { - // The "add satellite" action lives in the FAB (always - // visible); don't repeat it here — that showed the button - // twice on the empty page. return ChainEmptyState( icon: Icons.hub_outlined, title: l.federationEmptyTitle, hint: l.federationEmptyHint, + action: FilledButton.tonal( + onPressed: _addSatellite, + child: Text(l.federationAddSatellite), + ), ); } return ListView.separated(