archive button is not available if the pizza event is in the future
This commit is contained in:
parent
f7bc15d18a
commit
1b9741fe51
2 changed files with 3 additions and 5 deletions
|
@ -51,14 +51,14 @@ class PizzaEventsState extends State<PizzaEventsPage> {
|
||||||
},
|
},
|
||||||
child: const Text("View"),
|
child: const Text("View"),
|
||||||
),
|
),
|
||||||
TextButton(
|
if (pizzaEvent.dateTime.isBefore(DateTime.now())) TextButton(
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
Navigator.pop(context);
|
Navigator.pop(context);
|
||||||
pizzaEvent.archived = true;
|
pizzaEvent.archived = true;
|
||||||
pizzaEvent.save();
|
pizzaEvent.save();
|
||||||
},
|
},
|
||||||
child: const Text("Archive"),
|
child: const Text("Archive"),
|
||||||
),
|
) else const SizedBox(),
|
||||||
TextButton(
|
TextButton(
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
Navigator.pop(context);
|
Navigator.pop(context);
|
||||||
|
|
4
todo.md
4
todo.md
|
@ -13,6 +13,4 @@
|
||||||
- refactor to const page names instead of loose strings everywhere ('/path/page')
|
- refactor to const page names instead of loose strings everywhere ('/path/page')
|
||||||
- also do this with hive box names
|
- also do this with hive box names
|
||||||
|
|
||||||
## Bug
|
## Bug
|
||||||
- when deleting recipes, it deletes 2, but not when deleting the last one
|
|
||||||
- user should only be able to archive a pizza event that has taken place (dateTime>now)
|
|
Loading…
Add table
Reference in a new issue