feat: enhance EmptyStateView layout with positioned action button for better UX
This commit is contained in:
@@ -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(
|
||||||
|
|||||||
Reference in New Issue
Block a user