Reputation: 55
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
Reputation: 134
https://firebase.flutter.dev/docs/migration
DEPRECATED: onAuthStateChanged has been deprecated in favor of authStateChanges().
Upvotes: 8