Initial commit: CookIT recipe collection and week planner
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
commit
7d7a0bc60b
173 files changed
+22803
No files matched your search
@@ -0,0 +1,54 @@
|
||||
import 'package:drift_flutter/drift_flutter.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
import 'src/app.dart';
|
||||
import 'src/bundle/bundle_service.dart';
|
||||
import 'src/database/database.dart';
|
||||
import 'src/planning/plan_repository.dart';
|
||||
import 'src/planning/plan_share_service.dart';
|
||||
import 'src/planning/week_plan_provider.dart';
|
||||
import 'src/recipes/course_repository.dart';
|
||||
import 'src/recipes/photo_store.dart';
|
||||
import 'src/recipes/recipe_list_provider.dart';
|
||||
import 'src/recipes/recipe_repository.dart';
|
||||
import 'src/recipes/unit_catalog.dart';
|
||||
import 'src/recipes/unit_repository.dart';
|
||||
import 'src/settings/settings_controller.dart';
|
||||
import 'src/sharing/recipe_share_service.dart';
|
||||
|
||||
void main() async {
|
||||
WidgetsFlutterBinding.ensureInitialized();
|
||||
await SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp, DeviceOrientation.portraitDown]);
|
||||
|
||||
final db = AppDatabase(driftDatabase(name: 'cookit'));
|
||||
final photos = await PhotoStore.open();
|
||||
final recipes = RecipeRepository(db, photos);
|
||||
final courses = CourseRepository(db);
|
||||
final units = UnitRepository(db);
|
||||
final plan = PlanRepository(db);
|
||||
final bundles = BundleService(recipes, courses, units, photos);
|
||||
final settings = SettingsController(SettingsService());
|
||||
await settings.loadSettings();
|
||||
|
||||
runApp(
|
||||
MultiProvider(
|
||||
providers: [
|
||||
ChangeNotifierProvider.value(value: settings),
|
||||
Provider.value(value: photos),
|
||||
Provider.value(value: recipes),
|
||||
Provider.value(value: courses),
|
||||
Provider.value(value: units),
|
||||
Provider.value(value: plan),
|
||||
ChangeNotifierProvider(create: (_) => UnitCatalog(units)),
|
||||
Provider.value(value: bundles),
|
||||
Provider(create: (_) => RecipeShareService(recipes, courses, units, photos, bundles)),
|
||||
Provider(create: (_) => PlanShareService(recipes, courses, units, photos, plan, bundles)),
|
||||
ChangeNotifierProvider(create: (_) => RecipeListProvider(recipes, courses)),
|
||||
ChangeNotifierProvider(create: (_) => WeekPlanProvider(plan)),
|
||||
],
|
||||
child: const CookItApp(),
|
||||
),
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user