feat: enhance EmptyStateView layout with positioned action button for better UX

This commit is contained in:
Nils-Johan Gynther
2026-04-22 08:17:40 +02:00
parent 4b146483fe
commit 296a89b165
@@ -21,13 +21,19 @@ class InventoryScreen extends ConsumerWidget {
), ),
data: (items) { data: (items) {
if (items.isEmpty) { if (items.isEmpty) {
return EmptyStateView( return Stack(
title: 'Inventariet är tomt.', children: [
action: FloatingActionButton.extended( const EmptyStateView(title: 'Inventariet är tomt.'),
Positioned(
right: 16,
bottom: 16,
child: FloatingActionButton.extended(
onPressed: () => context.push('/inventory/create'), onPressed: () => context.push('/inventory/create'),
icon: const Icon(Icons.add), icon: const Icon(Icons.add),
label: const Text('Lägg till'), label: const Text('Lägg till'),
), ),
),
],
); );
} }
return Stack( return Stack(