feat(01-01): add core infrastructure, localization, and Wave 0 tests

- 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>
This commit is contained in:
2026-03-15 19:59:44 +01:00
parent 4b27aeadf6
commit 51738f78bc
17 changed files with 784 additions and 149 deletions

View File

@@ -0,0 +1,41 @@
import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:household_keeper/core/theme/theme_provider.dart';
void main() {
group('ThemeNotifier', () {
setUp(() {
SharedPreferences.setMockInitialValues({});
});
test('defaults to ThemeMode.system', () {
final container = ProviderContainer();
addTearDown(container.dispose);
final themeMode = container.read(themeProvider);
expect(themeMode, equals(ThemeMode.system));
});
test('setThemeMode(dark) updates state to dark', () async {
final container = ProviderContainer();
addTearDown(container.dispose);
await container.read(themeProvider.notifier).setThemeMode(
ThemeMode.dark,
);
expect(container.read(themeProvider), equals(ThemeMode.dark));
});
test('setThemeMode(light) updates state to light', () async {
final container = ProviderContainer();
addTearDown(container.dispose);
await container.read(themeProvider.notifier).setThemeMode(
ThemeMode.light,
);
expect(container.read(themeProvider), equals(ThemeMode.light));
});
});
}