From 1eabbaa00e871d07e2c78d512b11673db2472be0 Mon Sep 17 00:00:00 2001 From: Supermjork Date: Mon, 25 Dec 2023 18:38:49 +0200 Subject: [PATCH] Popup notifying of submitted data --- lib/input_data.dart | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/lib/input_data.dart b/lib/input_data.dart index 685b861..b5e1a99 100644 --- a/lib/input_data.dart +++ b/lib/input_data.dart @@ -86,6 +86,9 @@ class _InputDataState extends State { // Send //lingy plez + + //prompting of submission + showAlertDialog(context, selectedLine, selectedColor, formattedDate); }, child: Container( padding: const EdgeInsets.all(20.0), @@ -126,4 +129,32 @@ class _InputDataState extends State { ), ); } +} + +showAlertDialog(BuildContext context, String chosenLine, String chosenColour, String submissionDate) { + + // set up the button + Widget okButton = TextButton( + child: const Text("Pogchamp"), + onPressed: () { + Navigator.of(context).pop(); + }, + ); + + // set up the AlertDialog + AlertDialog alert = AlertDialog( + title: const Text("Submitted (Cached?) Info"), + content: Text("Tram Colour: $chosenColour\nChosen Line: $chosenLine\nSubmitted On:\n$submissionDate"), + actions: [ + okButton, + ], + ); + + // show the dialog + showDialog( + context: context, + builder: (BuildContext context) { + return alert; + }, + ); } \ No newline at end of file