mirror of
https://github.com/flutter/samples.git
synced 2026-05-08 16:06:40 +00:00
Migrate web dashboard to null safety (#928)
* update dependencies * Update to cloud_firestore 2.x.x * run dart migrate * Fix analyzer warnings from null safety migration * Fix errors resulting from null safety migration * Fix info level warnings * run flutter format * fix tests * remove unused import, format
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
import 'package:firebase_auth/firebase_auth.dart' hide FirebaseUser;
|
||||
import 'package:firebase_auth/firebase_auth.dart' hide User;
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:google_sign_in/google_sign_in.dart';
|
||||
|
||||
@@ -25,21 +25,21 @@ class FirebaseAuthService implements Auth {
|
||||
}
|
||||
|
||||
Future<User> _signIn() async {
|
||||
GoogleSignInAccount googleUser;
|
||||
GoogleSignInAccount? googleUser;
|
||||
if (await isSignedIn) {
|
||||
googleUser = await _googleSignIn.signInSilently();
|
||||
} else {
|
||||
googleUser = await _googleSignIn.signIn();
|
||||
}
|
||||
|
||||
var googleAuth = await googleUser.authentication;
|
||||
var googleAuth = await googleUser!.authentication;
|
||||
|
||||
var credential = GoogleAuthProvider.getCredential(
|
||||
var credential = GoogleAuthProvider.credential(
|
||||
accessToken: googleAuth.accessToken, idToken: googleAuth.idToken);
|
||||
|
||||
var authResult = await _auth.signInWithCredential(credential);
|
||||
|
||||
return _FirebaseUser(authResult.user.uid);
|
||||
return _FirebaseUser(authResult.user!.uid);
|
||||
}
|
||||
|
||||
@override
|
||||
|
||||
Reference in New Issue
Block a user