From d6ee80186e938c3a24aa62bb2cbce953b43ba507 Mon Sep 17 00:00:00 2001 From: Nikita0x Date: Tue, 3 Dec 2024 21:11:59 +0200 Subject: [PATCH 1/2] Removed duplicates; fixed typos; removed "unnecessary use of a null check" --- .../firebase_auth/lib/src/firebase_auth.dart | 17 +++++++---------- .../platform_interface_firebase_auth.dart | 15 ++++++--------- 2 files changed, 13 insertions(+), 19 deletions(-) diff --git a/packages/firebase_auth/firebase_auth/lib/src/firebase_auth.dart b/packages/firebase_auth/firebase_auth/lib/src/firebase_auth.dart index 4061d3640762..8ef022531acd 100644 --- a/packages/firebase_auth/firebase_auth/lib/src/firebase_auth.dart +++ b/packages/firebase_auth/firebase_auth/lib/src/firebase_auth.dart @@ -61,7 +61,7 @@ class FirebaseAuth extends FirebasePluginPlatform { /// [idTokenChanges] or [userChanges] to subscribe to updates. User? get currentUser { if (_delegate.currentUser != null) { - return User._(this, _delegate.currentUser!); + return User._(this, _delegate.currentUser); } return null; @@ -220,11 +220,8 @@ class FirebaseAuth extends FirebasePluginPlatform { /// - Thrown if the user is no longer authenticated since his refresh token /// has been expired /// - **network-request-failed**: - /// - Thrown if there was a network request error, for example the user don't - /// don't have internet connection - /// - **operation-not-allowed**: - /// - Thrown if email/password accounts are not enabled. Enable - /// email/password accounts in the Firebase Console, under the Auth tab. + /// - Thrown if there was a network request error, for example the user + /// doesn't have internet connection Future createUserWithEmailAndPassword({ required String email, required String password, @@ -498,7 +495,7 @@ class FirebaseAuth extends FirebasePluginPlatform { /// verification code of the credential is not valid. /// - **invalid-verification-id**: /// - Thrown if the credential is a [PhoneAuthProvider.credential] and the - /// verification ID of the credential is not valid.id. + /// verification ID of the credential is not valid. Future signInWithCredential(AuthCredential credential) async { try { return UserCredential._( @@ -570,12 +567,12 @@ class FirebaseAuth extends FirebasePluginPlatform { /// - Thrown if the user is no longer authenticated since his refresh token /// has been expired /// - **network-request-failed**: - /// - Thrown if there was a network request error, for example the user don't - /// don't have internet connection + /// - Thrown if there was a network request error, for example the user + /// doesn't have internet connection /// - **INVALID_LOGIN_CREDENTIALS** or **invalid-credential**: /// - Thrown if the password is invalid for the given email, or the account /// corresponding to the email does not have a password set. - /// depending on if you are using firebase emulator or not the code is + /// Depending on if you are using firebase emulator or not the code is /// different /// - **operation-not-allowed**: /// - Thrown if email/password accounts are not enabled. Enable diff --git a/packages/firebase_auth/firebase_auth_platform_interface/lib/src/platform_interface/platform_interface_firebase_auth.dart b/packages/firebase_auth/firebase_auth_platform_interface/lib/src/platform_interface/platform_interface_firebase_auth.dart index 5e2b64f53333..7d5c1eea38ca 100644 --- a/packages/firebase_auth/firebase_auth_platform_interface/lib/src/platform_interface/platform_interface_firebase_auth.dart +++ b/packages/firebase_auth/firebase_auth_platform_interface/lib/src/platform_interface/platform_interface_firebase_auth.dart @@ -236,11 +236,8 @@ abstract class FirebaseAuthPlatform extends PlatformInterface { /// - Thrown if the user is no longer authenticated since his refresh token /// has been expired /// - **network-request-failed**: - /// - Thrown if there was a network request error, for example the user don't - /// don't have internet connection - /// - **operation-not-allowed**: - /// - Thrown if email/password accounts are not enabled. Enable - /// email/password accounts in the Firebase Console, under the Auth tab. + /// - Thrown if there was a network request error, for example the user + /// doesn't have internet connection Future createUserWithEmailAndPassword( String email, String password, @@ -476,7 +473,7 @@ abstract class FirebaseAuthPlatform extends PlatformInterface { /// verification code of the credential is not valid. /// - **invalid-verification-id**: /// - Thrown if the credential is a [PhoneAuthProvider.credential] and the - /// verification ID of the credential is not valid.id. + /// verification ID of the credential is not valid. Future signInWithCredential( AuthCredential credential, ) async { @@ -527,12 +524,12 @@ abstract class FirebaseAuthPlatform extends PlatformInterface { /// - Thrown if the user is no longer authenticated since his refresh token /// has been expired /// - **network-request-failed**: - /// - Thrown if there was a network request error, for example the user don't - /// don't have internet connection + /// - Thrown if there was a network request error, for example the user + /// doesn't have internet connection /// - **INVALID_LOGIN_CREDENTIALS** or **invalid-credential**: /// - Thrown if the password is invalid for the given email, or the account /// corresponding to the email does not have a password set. - /// depending on if you are using firebase emulator or not the code is + /// Depending on if you are using firebase emulator or not the code is /// different /// - **operation-not-allowed**: /// - Thrown if email/password accounts are not enabled. Enable From 3bd65d7d5c478465699d1d26a1c7af801399761e Mon Sep 17 00:00:00 2001 From: Nikita0x Date: Mon, 6 Jan 2025 14:34:34 +0200 Subject: [PATCH 2/2] Removed the change according to russellwheatley --- packages/firebase_auth/firebase_auth/lib/src/firebase_auth.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/firebase_auth/firebase_auth/lib/src/firebase_auth.dart b/packages/firebase_auth/firebase_auth/lib/src/firebase_auth.dart index 8ef022531acd..e355fba73301 100644 --- a/packages/firebase_auth/firebase_auth/lib/src/firebase_auth.dart +++ b/packages/firebase_auth/firebase_auth/lib/src/firebase_auth.dart @@ -61,7 +61,7 @@ class FirebaseAuth extends FirebasePluginPlatform { /// [idTokenChanges] or [userChanges] to subscribe to updates. User? get currentUser { if (_delegate.currentUser != null) { - return User._(this, _delegate.currentUser); + return User._(this, _delegate.currentUser!); } return null;