How to write Firebase's instance in Kotlin

Issue @Module @InstallIn(ViewModelComponent::class) class HiltModule { @Provides fun provideAuthentication(): FirebaseAuth = Firebase.auth } Now I’m learning Kotlin. I think if I want to use an instance, I should do it below: @Module @InstallIn(ViewModelComponent::class) class HiltModule { @Provides fun provideAuthentication(){ FirebaseAuth

Continue reading

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

Issue 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);} Solution https://firebase.flutter.dev/docs/migration DEPRECATED: onAuthStateChanged has been deprecated

Continue reading