Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 721 Vote(s) - 3.55 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Undefined class 'AuthResult' in Flutter

#1
I have been trying to implement Google login screen using Flutter.

```dart
final AuthResult authResult = await _auth.signInWithCredential(credential);
```

The editor, for the line above, says:

> Undefined class 'AuthResult'

How can I fix it? Any help would be very appreciated.
Reply

#2
The problem was firebase_auth version that I added to *pubspec.yaml*.

Previous version I have been using:
`firebase_auth: ^0.11.1+8`

Now: `firebase_auth: ^0.15.2`

This change on versions has fixed the problem.
Reply

#3
They renamed the class `AuthResult` to `UserCredential`
Reply

#4
Starting from Version firebase_auth 0.18.0:
-------------------------------------------

`FirebaseUser` has been changed to `User`

`AuthResult` has been changed to `UserCredential`

`GoogleAuthProvider.getCredential()` has been changed to `GoogleAuthProvider.credential()`

`onAuthStateChanged` which notifies about changes to the user's sign-in state was replaced with `authStateChanges()`

`currentUser()` which is a method to retrieve the currently logged in user, was replaced with the property `currentUser` and it no longer returns a `Future<FirebaseUser>`
Reply

#5
In 2020 firebase_Auth_version(0.18.3+1), they changed from `AuthResult` to `UserCredential`, and `GetCredentials` deprecated to `credentials`.
Reply

#6
**`AuthResult`** has been changed to **`UserCredential`**
Reply

#7
In 2021 firebase_auth_version of ^3.0.1,
**AuthException** has also been change to **FirebaseAuthException**
Reply

#8
```
final UserCredential authResult = await _auth.signInWithCredential(credential);
```
Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through