Initialise l'app Flutter mobile : BDD Drift, onboarding sans compte et tableau de bord.
Phase 1 du MVP : schéma SQLite porté depuis le prototype web, seed des règles/récompenses, flux d'onboarding en 4 étapes et écran d'accueil minimal. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
|
||||
import '../data/database/app_database.dart';
|
||||
import '../data/repositories/onboarding_repository.dart';
|
||||
|
||||
final databaseProvider = Provider<AppDatabase>((ref) {
|
||||
final db = AppDatabase();
|
||||
ref.onDispose(db.close);
|
||||
return db;
|
||||
});
|
||||
|
||||
final onboardingRepositoryProvider = Provider<OnboardingRepository>((ref) {
|
||||
return OnboardingRepository(ref.watch(databaseProvider));
|
||||
});
|
||||
|
||||
final onboardingCompleteProvider = FutureProvider<bool>((ref) async {
|
||||
final repo = ref.watch(onboardingRepositoryProvider);
|
||||
return repo.isComplete();
|
||||
});
|
||||
|
||||
final childrenProvider = FutureProvider<List<Enfant>>((ref) async {
|
||||
final db = ref.watch(databaseProvider);
|
||||
return db.listChildren();
|
||||
});
|
||||
Reference in New Issue
Block a user