change container creation handling
This commit is contained in:
@@ -134,7 +134,7 @@ class ContainerEditScreen extends HookConsumerWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (context.mounted) {
|
if (context.mounted) {
|
||||||
context.pop();
|
context.pop(container);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
icon: const Icon(Icons.check),
|
icon: const Icon(Icons.check),
|
||||||
|
|||||||
@@ -156,15 +156,9 @@ class ContainerListScreen extends HookConsumerWidget {
|
|||||||
.unusedRandomContainerColor();
|
.unusedRandomContainerColor();
|
||||||
|
|
||||||
if (context.mounted) {
|
if (context.mounted) {
|
||||||
final result = await ContainerCreateRoute(
|
await ContainerCreateRoute(
|
||||||
ContainerData(id: uuid.v7(), color: initialColor),
|
ContainerData(id: uuid.v7(), color: initialColor),
|
||||||
).push<ContainerData?>(context);
|
).push(context);
|
||||||
|
|
||||||
if (result != null) {
|
|
||||||
await ref
|
|
||||||
.read(containerRepositoryProvider.notifier)
|
|
||||||
.addContainer(result);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
label: const Text('Container'),
|
label: const Text('Container'),
|
||||||
|
|||||||
+2
-8
@@ -83,15 +83,9 @@ class ContainerSelectionScreen extends HookConsumerWidget {
|
|||||||
.unusedRandomContainerColor();
|
.unusedRandomContainerColor();
|
||||||
|
|
||||||
if (context.mounted) {
|
if (context.mounted) {
|
||||||
final result = await ContainerCreateRoute(
|
await ContainerCreateRoute(
|
||||||
ContainerData(id: uuid.v7(), color: initialColor),
|
ContainerData(id: uuid.v7(), color: initialColor),
|
||||||
).push<ContainerData?>(context);
|
).push(context);
|
||||||
|
|
||||||
if (result != null) {
|
|
||||||
await ref
|
|
||||||
.read(containerRepositoryProvider.notifier)
|
|
||||||
.addContainer(result);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
label: const Text('Container'),
|
label: const Text('Container'),
|
||||||
|
|||||||
Reference in New Issue
Block a user