fix: await firebase init and anonymous auth (#439)

pull/440/head
Jorge Coca 2 years ago committed by GitHub
parent 461471b01f
commit 43ceb0db32
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1,5 +1,3 @@
import 'dart:async';
import 'package:authentication_repository/authentication_repository.dart'; import 'package:authentication_repository/authentication_repository.dart';
import 'package:firebase_core/firebase_core.dart'; import 'package:firebase_core/firebase_core.dart';
import 'package:leaderboard_repository/leaderboard_repository.dart'; import 'package:leaderboard_repository/leaderboard_repository.dart';
@ -17,11 +15,8 @@ void main() {
final authenticationRepository = AuthenticationRepository(firebaseAuth); final authenticationRepository = AuthenticationRepository(firebaseAuth);
final pinballAudioPlayer = PinballAudioPlayer(); final pinballAudioPlayer = PinballAudioPlayer();
final platformHelper = PlatformHelper(); final platformHelper = PlatformHelper();
unawaited( await Firebase.initializeApp();
Firebase.initializeApp().then( await authenticationRepository.authenticateAnonymously();
(_) => authenticationRepository.authenticateAnonymously(),
),
);
return App( return App(
authenticationRepository: authenticationRepository, authenticationRepository: authenticationRepository,
leaderboardRepository: leaderboardRepository, leaderboardRepository: leaderboardRepository,

Loading…
Cancel
Save