From 8ae43c6f8c97dffe0909ab4d63b2c6b1511a8fa9 Mon Sep 17 00:00:00 2001 From: longnguyen Date: Wed, 11 Dec 2024 15:33:26 +0700 Subject: [PATCH] Fix format code --- lib/features/login/bloc/login_cubit.dart | 20 +++++++++++++++----- lib/firebase_options.dart | 15 +++++++++------ lib/l10n/text_ui_static.dart | 3 +-- 3 files changed, 25 insertions(+), 13 deletions(-) diff --git a/lib/features/login/bloc/login_cubit.dart b/lib/features/login/bloc/login_cubit.dart index 9435853..1cd7d37 100644 --- a/lib/features/login/bloc/login_cubit.dart +++ b/lib/features/login/bloc/login_cubit.dart @@ -35,14 +35,17 @@ class LoginCubit extends Cubit { } Future _authenticateToFirebase(GoogleSignInAccount googleUser) async { - final GoogleSignInAuthentication googleAuth = await googleUser.authentication; + final GoogleSignInAuthentication googleAuth = + await googleUser.authentication; - final OAuthCredential oAuthCredential = GoogleAuthProvider.credential(accessToken: googleAuth.accessToken, idToken: googleAuth.idToken); + final OAuthCredential oAuthCredential = GoogleAuthProvider.credential( + accessToken: googleAuth.accessToken, idToken: googleAuth.idToken); final FirebaseAuth firebaseAuth = FirebaseAuth.instance; final Database database = ServiceLocator.instance.get(); try { - final UserCredential userCredential = await firebaseAuth.signInWithCredential(oAuthCredential); + final UserCredential userCredential = + await firebaseAuth.signInWithCredential(oAuthCredential); final User? user = userCredential.user; if (user == null) { @@ -64,13 +67,20 @@ class LoginCubit extends Cubit { Future requestLogout() async { try { emitSafely(LogoutLoading()); - await FirebaseAuth.instance.signOut().then((value) => emitSafely(LogoutSuccess())); + await FirebaseAuth.instance + .signOut() + .then((value) => emitSafely(LogoutSuccess())); } on PlatformException catch (e) { emitSafely(LoginFailed(e.toString())); } } bool checkCountryCodeLocalExisted() { - return (ServiceLocator.instance.get().get(Constants.prefCurrentCountryCode)?.toString() ?? '').isNotEmpty; + return (ServiceLocator.instance + .get() + .get(Constants.prefCurrentCountryCode) + ?.toString() ?? + '') + .isNotEmpty; } } diff --git a/lib/firebase_options.dart b/lib/firebase_options.dart index 105d3b9..a453d31 100644 --- a/lib/firebase_options.dart +++ b/lib/firebase_options.dart @@ -63,8 +63,10 @@ class DefaultFirebaseOptions { messagingSenderId: '680152053567', projectId: 'select-languages', storageBucket: 'select-languages.firebasestorage.app', - androidClientId: '680152053567-emkdlcus6e32uip0iai5n9mju9um4lqb.apps.googleusercontent.com', - iosClientId: '680152053567-ohe8r3a5dba9i28fd1lre7tidbe4bufl.apps.googleusercontent.com', + androidClientId: + '680152053567-emkdlcus6e32uip0iai5n9mju9um4lqb.apps.googleusercontent.com', + iosClientId: + '680152053567-ohe8r3a5dba9i28fd1lre7tidbe4bufl.apps.googleusercontent.com', iosBundleId: 'com.longndutc.publicchat', ); @@ -74,8 +76,10 @@ class DefaultFirebaseOptions { messagingSenderId: '680152053567', projectId: 'select-languages', storageBucket: 'select-languages.firebasestorage.app', - androidClientId: '680152053567-emkdlcus6e32uip0iai5n9mju9um4lqb.apps.googleusercontent.com', - iosClientId: '680152053567-ohe8r3a5dba9i28fd1lre7tidbe4bufl.apps.googleusercontent.com', + androidClientId: + '680152053567-emkdlcus6e32uip0iai5n9mju9um4lqb.apps.googleusercontent.com', + iosClientId: + '680152053567-ohe8r3a5dba9i28fd1lre7tidbe4bufl.apps.googleusercontent.com', iosBundleId: 'com.longndutc.publicchat', ); @@ -87,5 +91,4 @@ class DefaultFirebaseOptions { authDomain: 'select-languages.firebaseapp.com', storageBucket: 'select-languages.firebasestorage.app', ); - -} \ No newline at end of file +} diff --git a/lib/l10n/text_ui_static.dart b/lib/l10n/text_ui_static.dart index 30c6197..681ddb0 100644 --- a/lib/l10n/text_ui_static.dart +++ b/lib/l10n/text_ui_static.dart @@ -61,6 +61,5 @@ class TextsUIStatic { Map> get texts => _text; - set setTexts(Map> newTexts) => - _text = newTexts; + set setTexts(Map> newTexts) => _text = newTexts; }