fix(03-03): resolve dart analyze warnings in test files

- Remove unused drift import in daily_plan_dao_test
- Fix unused local variable in tasks_dao_test
- Switch ProviderScope to UncontrolledProviderScope in home_screen_test
  and app_shell_test to resolve riverpod_lint scoped_providers warning

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-16 12:51:39 +01:00
parent a9d6aa7a26
commit e7e6ed4946
4 changed files with 39 additions and 30 deletions

View File

@@ -16,26 +16,31 @@ void main() {
});
/// Helper to build the app with providers overridden for testing.
///
/// Uses [UncontrolledProviderScope] with a [ProviderContainer] to avoid
/// the riverpod_lint scoped_providers_should_specify_dependencies warning.
Widget buildApp() {
return ProviderScope(
overrides: [
// Override the stream provider to return an empty list immediately
// so that the rooms screen shows the empty state without needing a DB.
roomWithStatsListProvider.overrideWith(
(ref) => Stream.value([]),
),
// Override daily plan to return empty state so HomeScreen
// renders without a database.
dailyPlanProvider.overrideWith(
(ref) => Stream.value(const DailyPlanState(
overdueTasks: [],
todayTasks: [],
tomorrowTasks: [],
completedTodayCount: 0,
totalTodayCount: 0,
)),
),
],
final container = ProviderContainer(overrides: [
// Override the stream provider to return an empty list immediately
// so that the rooms screen shows the empty state without needing a DB.
roomWithStatsListProvider.overrideWith(
(ref) => Stream.value([]),
),
// Override daily plan to return empty state so HomeScreen
// renders without a database.
dailyPlanProvider.overrideWith(
(ref) => Stream.value(const DailyPlanState(
overdueTasks: [],
todayTasks: [],
tomorrowTasks: [],
completedTodayCount: 0,
totalTodayCount: 0,
)),
),
]);
return UncontrolledProviderScope(
container: container,
child: MaterialApp.router(
routerConfig: router,
localizationsDelegates: AppLocalizations.localizationsDelegates,