diff --git a/lib/main.dart b/lib/main.dart index ddbb8c6..c06105c 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -9,6 +9,7 @@ import 'package:pizzaplanner/pages/PizzaEventsPage.dart'; import 'package:hive/hive.dart'; import 'package:hive_flutter/hive_flutter.dart'; +import 'package:pizzaplanner/util.dart'; void main() async { await Hive.initFlutter(); @@ -20,7 +21,11 @@ void main() async { Hive.registerAdapter(PizzaEventAdapter()); await Hive.openBox("PizzaEvents"); - await Hive.openBox("PizzaRecipes"); + var pizzaRecipesBox = await Hive.openBox("PizzaRecipes"); + + if (pizzaRecipesBox.isEmpty){ + pizzaRecipesBox.addAll(await getRecipes()); + } runApp(PizzaPlanner());