aizadaizadaizad
aizadaizadaizad

Reputation: 55

The getter 'AuthStateChanges' isn't defined for the type 'FirebaseAuth'

I'm trying to get UserProvider for Firebase Auth but the error says:

The getter 'AuthStateChanges' isn't defined for the type 'FirebaseAuth'.

and

Undefined name '_onStateChanged'.

UserProvider.initialize() : _auth = FirebaseAuth.instance {
_auth.AuthStateChanges.listen(_onStateChanged);}

Upvotes: 3

Views: 3752

Answers (2)

P1not
P1not

Reputation: 181

Use authStateChanges() in favor of authStateChanges()

Upvotes: 0

Igor Gomes
Igor Gomes

Reputation: 134

https://firebase.flutter.dev/docs/migration

DEPRECATED: onAuthStateChanged has been deprecated in favor of authStateChanges().

Upvotes: 8

Related Questions