in between commit
This commit is contained in:
parent
757b43779d
commit
7207686bbc
3 changed files with 73 additions and 3 deletions
|
@ -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());
|
||||
}
|
||||
|
|
|
@ -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<PizzaEventNotificationPage> {
|
|||
child: TextButton(
|
||||
child: Text("Ignore", style: TextStyle(color: Colors.white)),
|
||||
onPressed: () async {
|
||||
|
||||
Navigator.pop(context);
|
||||
},
|
||||
)
|
||||
)
|
||||
|
@ -120,7 +123,15 @@ class PizzaEventNotificationState extends State<PizzaEventNotificationPage> {
|
|||
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
|
||||
)
|
||||
);
|
||||
},
|
||||
)
|
||||
)
|
||||
|
|
56
lib/pages/RecipeStepInstructionPage.dart
Normal file
56
lib/pages/RecipeStepInstructionPage.dart
Normal file
|
@ -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<RecipeStepInstructionPage> {
|
||||
|
||||
@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: <Widget>[
|
||||
ExpansionTile(
|
||||
title: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: <Widget>[
|
||||
Text(this.widget.recipeStep.name),
|
||||
|
||||
],
|
||||
),
|
||||
children: <Widget>[
|
||||
|
||||
],
|
||||
)
|
||||
]
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
Loading…
Add table
Reference in a new issue