diff --git a/lib/main.dart b/lib/main.dart index cd9b34d..9636bef 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -14,6 +14,7 @@ import 'package:pizzaplanner/pages/PizzaEventsPage.dart'; import 'package:hive/hive.dart'; import 'package:hive_flutter/hive_flutter.dart'; +import 'package:pizzaplanner/pages/RecipeStepInstructionPage.dart'; import 'package:pizzaplanner/util.dart'; import 'package:rxdart/subjects.dart'; @@ -141,7 +142,9 @@ class RouteGenerator { return MaterialPageRoute(builder: (context) => PizzaEventsPage()); } } - + case "/event/recipe_step": { + return MaterialPageRoute(builder: (context) => RecipeStepInstructionPage(settings.arguments as RecipeStepInstructionPageArguments)); + } default: { return MaterialPageRoute(builder: (context) => PizzaEventsPage()); } diff --git a/lib/pages/PizzaEventNotificationPage.dart b/lib/pages/PizzaEventNotificationPage.dart index 2b1177d..de9c14f 100644 --- a/lib/pages/PizzaEventNotificationPage.dart +++ b/lib/pages/PizzaEventNotificationPage.dart @@ -5,9 +5,12 @@ import 'package:hive/hive.dart'; import 'package:pizzaplanner/entities/PizzaEvent.dart'; import 'package:pizzaplanner/entities/PizzaRecipe/RecipeStep.dart'; import 'package:pizzaplanner/main.dart'; +import 'package:pizzaplanner/pages/RecipeStepInstructionPage.dart'; import 'package:timezone/timezone.dart' as tz; + + class PizzaEventNotificationPage extends StatefulWidget { final String? payload; @@ -70,7 +73,7 @@ class PizzaEventNotificationState extends State { child: TextButton( child: Text("Ignore", style: TextStyle(color: Colors.white)), onPressed: () async { - + Navigator.pop(context); }, ) ) @@ -120,7 +123,15 @@ class PizzaEventNotificationState extends State { child: TextButton( child: Text("Start!", style: TextStyle(color: Colors.white)), onPressed: () async { - + Navigator.pop(context); + Navigator.pushNamed( + context, + "/event/recipe_step", + arguments: RecipeStepInstructionPageArguments( + pizzaEvent, + recipeStep + ) + ); }, ) ) diff --git a/lib/pages/RecipeStepInstructionPage.dart b/lib/pages/RecipeStepInstructionPage.dart new file mode 100644 index 0000000..f81cddc --- /dev/null +++ b/lib/pages/RecipeStepInstructionPage.dart @@ -0,0 +1,56 @@ +import 'package:flutter/material.dart'; +import 'package:pizzaplanner/entities/PizzaEvent.dart'; +import 'package:pizzaplanner/entities/PizzaRecipe/RecipeStep.dart'; + +class RecipeStepInstructionPageArguments { + final PizzaEvent pizzaEvent; + final RecipeStep recipeStep; + + RecipeStepInstructionPageArguments(this.pizzaEvent, this.recipeStep); +} + +class RecipeStepInstructionPage extends StatefulWidget { + late final PizzaEvent pizzaEvent; + late final RecipeStep recipeStep; + + RecipeStepInstructionPage(RecipeStepInstructionPageArguments arguments) { + this.pizzaEvent = arguments.pizzaEvent; + this.recipeStep = arguments.recipeStep; + } + + + @override + RecipeStepInstructionState createState() => RecipeStepInstructionState(); +} + +class RecipeStepInstructionState extends State { + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + title: Text("From notification"), + ), + resizeToAvoidBottomInset: false, + body: Container( + padding: EdgeInsets.fromLTRB(40, 10, 40, 10), + child: ListView( + children: [ + ExpansionTile( + title: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text(this.widget.recipeStep.name), + + ], + ), + children: [ + + ], + ) + ] + ) + ) + ); + } +} \ No newline at end of file