recipes can be added to db from createpage
This commit is contained in:
@@ -2,6 +2,8 @@ import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:rezepte/services/providers/recipe_provider.dart';
|
||||
|
||||
import '../models/recipe.dart';
|
||||
|
||||
class RecipeDetail extends StatelessWidget {
|
||||
const RecipeDetail({super.key});
|
||||
static const routeName = '/recipeDetail';
|
||||
@@ -10,6 +12,9 @@ class RecipeDetail extends StatelessWidget {
|
||||
Widget build(BuildContext context) {
|
||||
final recipe = Provider.of<RecipeProvider>(context, listen: false).recipe;
|
||||
|
||||
if (recipe == null) Navigator.of(context).pop();
|
||||
recipe as Recipe;
|
||||
|
||||
return Scaffold(
|
||||
appBar: AppBar(),
|
||||
body: Center(
|
||||
|
||||
Reference in New Issue
Block a user