fix(federation): primary action in the app bar and empty state, no FAB

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 <stefan.a.flemming@googlemail.com>
This commit is contained in:
flemming-it 2026-07-18 00:08:51 +02:00
parent b52590c7d3
commit 0e53572589

View file

@ -93,6 +93,19 @@ class _FederationPageState extends State<FederationPage> {
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<FederationPage> {
const SizedBox(width: ChainSpace.sm),
],
),
floatingActionButton: FloatingActionButton.extended(
onPressed: _addSatellite,
icon: const Icon(Icons.add_link),
label: Text(l.federationAddSatellite),
),
body: FutureBuilder<List<Satellite>>(
future: _future,
builder: (context, snapshot) {
@ -131,13 +139,14 @@ class _FederationPageState extends State<FederationPage> {
}
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(