renamed add/edit route
This commit is contained in:
parent
cadbd3b631
commit
6361255e45
2 changed files with 3 additions and 3 deletions
|
@ -170,7 +170,7 @@ class RouteGenerator {
|
||||||
case "/recipes/view": {
|
case "/recipes/view": {
|
||||||
return MaterialPageRoute(builder: (context) => RecipesPage());
|
return MaterialPageRoute(builder: (context) => RecipesPage());
|
||||||
}
|
}
|
||||||
case "/recipes/add": {
|
case "/recipes/edit": {
|
||||||
return MaterialPageRoute(builder: (context) => EditRecipePage(pizzaRecipe: settings.arguments as PizzaRecipe?));
|
return MaterialPageRoute(builder: (context) => EditRecipePage(pizzaRecipe: settings.arguments as PizzaRecipe?));
|
||||||
}
|
}
|
||||||
case "/recipes/add/edit_step": {
|
case "/recipes/add/edit_step": {
|
||||||
|
|
|
@ -21,7 +21,7 @@ class RecipesPage extends StatelessWidget {
|
||||||
width: double.infinity,
|
width: double.infinity,
|
||||||
child: TextButton(
|
child: TextButton(
|
||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
Navigator.pushNamed(context, "/recipes/add");
|
Navigator.pushNamed(context, "/recipes/edit");
|
||||||
},
|
},
|
||||||
child: const Text("New Recipe", style: TextStyle(color: Colors.white)),
|
child: const Text("New Recipe", style: TextStyle(color: Colors.white)),
|
||||||
)
|
)
|
||||||
|
@ -46,7 +46,7 @@ class RecipesPage extends StatelessWidget {
|
||||||
Navigator.pushNamed(context, "/recipe/view", arguments: pizzaRecipe);
|
Navigator.pushNamed(context, "/recipe/view", arguments: pizzaRecipe);
|
||||||
},
|
},
|
||||||
onLongPress: () {
|
onLongPress: () {
|
||||||
Navigator.pushNamed(context, "/recipes/add", arguments: pizzaRecipe);
|
Navigator.pushNamed(context, "/recipes/edit", arguments: pizzaRecipe);
|
||||||
},
|
},
|
||||||
child: PizzaRecipeWidget(pizzaRecipe),
|
child: PizzaRecipeWidget(pizzaRecipe),
|
||||||
);
|
);
|
||||||
|
|
Loading…
Add table
Reference in a new issue