From 05a418cc67894b68444e387a66689b0d4d86b6b9 Mon Sep 17 00:00:00 2001 From: broodjeaap89 Date: Tue, 24 Aug 2021 20:23:19 +0200 Subject: [PATCH] added handling of the ignore button on the notification page --- lib/pages/PizzaEventNotificationPage.dart | 33 +++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) diff --git a/lib/pages/PizzaEventNotificationPage.dart b/lib/pages/PizzaEventNotificationPage.dart index de9c14f..bad05f3 100644 --- a/lib/pages/PizzaEventNotificationPage.dart +++ b/lib/pages/PizzaEventNotificationPage.dart @@ -73,7 +73,9 @@ class PizzaEventNotificationState extends State { child: TextButton( child: Text("Ignore", style: TextStyle(color: Colors.white)), onPressed: () async { - Navigator.pop(context); + showDialog(context: context, builder: (BuildContext context) { + return buildIgnoreDialog(); + }); }, ) ) @@ -141,4 +143,31 @@ class PizzaEventNotificationState extends State { ) ); } -} \ No newline at end of file + + AlertDialog buildIgnoreDialog(){ + return AlertDialog( + title: Text("This step will be marked as completed."), + content: Text("Instructions for this step can still be viewed on the Pizza Event page"), + actions: [ + TextButton( + child: Text("Back"), + onPressed: () { + Navigator.pop(context); + }, + ), + TextButton( + child: Text("Complete"), + onPressed: () { + setState(() { + recipeStep.completeStepNow(); + }); + pizzaEvent.save(); + Navigator.pop(context); + Navigator.pop(context); + }, + ), + ] + ); + } +} +