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"),
|
||||
),
|
||||
TextButton(
|
||||
if (pizzaEvent.dateTime.isBefore(DateTime.now())) TextButton(
|
||||
onPressed: () {
|
||||
Navigator.pop(context);
|
||||
pizzaEvent.archived = true;
|
||||
pizzaEvent.save();
|
||||
},
|
||||
child: const Text("Archive"),
|
||||
),
|
||||
) else const SizedBox(),
|
||||
TextButton(
|
||||
onPressed: () {
|
||||
Navigator.pop(context);
|
||||
|
|
2
todo.md
2
todo.md
|
@ -14,5 +14,3 @@
|
|||
- also do this with hive box names
|
||||
|
||||
## 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