- AppDatabase with schemaVersion 1, in-memory executor for testing - Database provider with @Riverpod(keepAlive: true) - AppTheme with sage green seed ColorScheme and warm surface overrides - ThemeNotifier with SharedPreferences persistence, defaults to system - Full German ARB localization (15 keys) with proper umlauts - Minimal main.dart with ProviderScope placeholder - Drift schema v1 captured via make-migrations - All .g.dart files generated via build_runner - Wave 0 tests: database (3), color scheme (6), theme (3), localization (2) -- 14 total, all passing Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
23 lines
579 B
Dart
23 lines
579 B
Dart
import 'package:drift/drift.dart';
|
|
import 'package:drift_flutter/drift_flutter.dart';
|
|
import 'package:path_provider/path_provider.dart';
|
|
|
|
part 'database.g.dart';
|
|
|
|
@DriftDatabase(tables: [])
|
|
class AppDatabase extends _$AppDatabase {
|
|
AppDatabase([QueryExecutor? executor]) : super(executor ?? _openConnection());
|
|
|
|
@override
|
|
int get schemaVersion => 1;
|
|
|
|
static QueryExecutor _openConnection() {
|
|
return driftDatabase(
|
|
name: 'household_keeper',
|
|
native: const DriftNativeOptions(
|
|
databaseDirectory: getApplicationSupportDirectory,
|
|
),
|
|
);
|
|
}
|
|
}
|