diff --git a/lib/app/view/app.dart b/lib/app/view/app.dart index f629075fa..c3281b489 100644 --- a/lib/app/view/app.dart +++ b/lib/app/view/app.dart @@ -1,4 +1,5 @@ import 'package:api_client/api_client.dart'; +import 'package:authentication_repository/authentication_repository.dart'; import 'package:board_info_repository/board_info_repository.dart'; import 'package:crossword_repository/crossword_repository.dart'; import 'package:flutter/material.dart'; @@ -15,10 +16,12 @@ class App extends StatelessWidget { required this.apiClient, required this.crosswordRepository, required this.boardInfoRepository, + required this.user, super.key, }); final ApiClient apiClient; + final User user; final CrosswordRepository crosswordRepository; final BoardInfoRepository boardInfoRepository; @@ -29,6 +32,7 @@ class App extends StatelessWidget { return MultiProvider( providers: [ Provider.value(value: apiClient.leaderboardResource), + Provider.value(value: user), Provider.value(value: crosswordResource), Provider.value(value: crosswordRepository), Provider.value(value: boardInfoRepository), diff --git a/lib/main_debug.dart b/lib/main_debug.dart index 3b0ca0417..65c11af11 100644 --- a/lib/main_debug.dart +++ b/lib/main_debug.dart @@ -59,6 +59,7 @@ void main() async { apiClient: apiClient, crosswordRepository: CrosswordRepository(db: firestore), boardInfoRepository: BoardInfoRepository(firestore: firestore), + user: await authenticationRepository.user.first, ); }, ), diff --git a/lib/main_development.dart b/lib/main_development.dart index 6ba325d91..9abea05db 100644 --- a/lib/main_development.dart +++ b/lib/main_development.dart @@ -56,6 +56,7 @@ void main() async { apiClient: apiClient, crosswordRepository: CrosswordRepository(db: firestore), boardInfoRepository: BoardInfoRepository(firestore: firestore), + user: await authenticationRepository.user.first, ); }, ), diff --git a/lib/main_local.dart b/lib/main_local.dart index 62919b5b2..ed61702b3 100644 --- a/lib/main_local.dart +++ b/lib/main_local.dart @@ -53,6 +53,7 @@ void main() async { apiClient: apiClient, crosswordRepository: CrosswordRepository(db: firestore), boardInfoRepository: BoardInfoRepository(firestore: firestore), + user: await authenticationRepository.user.first, ); }, ), diff --git a/lib/main_production.dart b/lib/main_production.dart index 495d6195d..363473047 100644 --- a/lib/main_production.dart +++ b/lib/main_production.dart @@ -47,6 +47,7 @@ void main() async { apiClient: apiClient, crosswordRepository: CrosswordRepository(db: firestore), boardInfoRepository: BoardInfoRepository(firestore: firestore), + user: await authenticationRepository.user.first, ); }, ), diff --git a/lib/main_staging.dart b/lib/main_staging.dart index 1912d7401..97226e4dd 100644 --- a/lib/main_staging.dart +++ b/lib/main_staging.dart @@ -56,6 +56,7 @@ void main() async { apiClient: apiClient, crosswordRepository: CrosswordRepository(db: firestore), boardInfoRepository: BoardInfoRepository(firestore: firestore), + user: await authenticationRepository.user.first, ); }, ), diff --git a/test/app/view/app_test.dart b/test/app/view/app_test.dart index 0d543b224..daa5f92c5 100644 --- a/test/app/view/app_test.dart +++ b/test/app/view/app_test.dart @@ -1,6 +1,7 @@ // ignore_for_file: prefer_const_constructors import 'package:api_client/api_client.dart'; +import 'package:authentication_repository/authentication_repository.dart'; import 'package:bloc_test/bloc_test.dart'; import 'package:board_info_repository/board_info_repository.dart'; import 'package:crossword_repository/crossword_repository.dart'; @@ -25,6 +26,8 @@ class _MockCrosswordResource extends Mock implements CrosswordResource {} class _MockCrosswordBloc extends Mock implements CrosswordBloc {} +class _MockUser extends Mock implements User {} + void main() { group('App', () { late ApiClient apiClient; @@ -59,6 +62,7 @@ void main() { apiClient: apiClient, crosswordRepository: crosswordRepository, boardInfoRepository: boardInfoRepository, + user: _MockUser(), ), );