-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
107 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import 'dart:async'; | ||
|
||
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:firebase_core/firebase_core.dart'; | ||
import 'package:flutter/widgets.dart'; | ||
import 'package:io_crossword/app/app.dart'; | ||
import 'package:io_crossword/bootstrap.dart'; | ||
import 'package:io_crossword/firebase_options_development.dart'; | ||
|
||
void main() async { | ||
WidgetsFlutterBinding.ensureInitialized(); | ||
|
||
await Firebase.initializeApp( | ||
options: DefaultFirebaseOptions.currentPlatform, | ||
); | ||
|
||
unawaited( | ||
bootstrap( | ||
(firestore, firebaseAuth) async { | ||
final authenticationRepository = AuthenticationRepository( | ||
firebaseAuth: firebaseAuth, | ||
); | ||
|
||
await authenticationRepository.signInAnonymously(); | ||
await authenticationRepository.idToken.first; | ||
|
||
final apiClient = ApiClient( | ||
baseUrl: 'http://localhost:8080', | ||
idTokenStream: authenticationRepository.idToken, | ||
refreshIdToken: authenticationRepository.refreshIdToken, | ||
// TODO(any): implement app check | ||
appCheckTokenStream: const Stream.empty(), | ||
); | ||
|
||
return App( | ||
apiClient: apiClient, | ||
crosswordRepository: CrosswordRepository(db: firestore), | ||
boardInfoRepository: BoardInfoRepository(firestore: firestore), | ||
); | ||
}, | ||
), | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters