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:
parent
b52590c7d3
commit
0e53572589
1 changed files with 17 additions and 8 deletions
|
|
@ -93,6 +93,19 @@ class _FederationPageState extends State<FederationPage> {
|
||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
title: Text(l.federationTitle),
|
title: Text(l.federationTitle),
|
||||||
actions: [
|
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(
|
IconButton(
|
||||||
icon: const Icon(Icons.help_outline, size: 18),
|
icon: const Icon(Icons.help_outline, size: 18),
|
||||||
tooltip: l.helpTooltip,
|
tooltip: l.helpTooltip,
|
||||||
|
|
@ -106,11 +119,6 @@ class _FederationPageState extends State<FederationPage> {
|
||||||
const SizedBox(width: ChainSpace.sm),
|
const SizedBox(width: ChainSpace.sm),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
floatingActionButton: FloatingActionButton.extended(
|
|
||||||
onPressed: _addSatellite,
|
|
||||||
icon: const Icon(Icons.add_link),
|
|
||||||
label: Text(l.federationAddSatellite),
|
|
||||||
),
|
|
||||||
body: FutureBuilder<List<Satellite>>(
|
body: FutureBuilder<List<Satellite>>(
|
||||||
future: _future,
|
future: _future,
|
||||||
builder: (context, snapshot) {
|
builder: (context, snapshot) {
|
||||||
|
|
@ -131,13 +139,14 @@ class _FederationPageState extends State<FederationPage> {
|
||||||
}
|
}
|
||||||
final sats = snapshot.data ?? [];
|
final sats = snapshot.data ?? [];
|
||||||
if (sats.isEmpty) {
|
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(
|
return ChainEmptyState(
|
||||||
icon: Icons.hub_outlined,
|
icon: Icons.hub_outlined,
|
||||||
title: l.federationEmptyTitle,
|
title: l.federationEmptyTitle,
|
||||||
hint: l.federationEmptyHint,
|
hint: l.federationEmptyHint,
|
||||||
|
action: FilledButton.tonal(
|
||||||
|
onPressed: _addSatellite,
|
||||||
|
child: Text(l.federationAddSatellite),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
return ListView.separated(
|
return ListView.separated(
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue