Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to fix FirebaseAuth.instance.currentUser() in flutter app using firebase_auth package? It is always returning null

I am using the firebase_auth package to implement the authentication functionality in my flutter application and for auto-login of user I need a response from FirebaseAuth.instance.currentUser() which is always returning null. They have a Github issue here but it is closed and not have much details.

Here is the link to package description. Do I need to migrate my project to AndroidX to make things work? Is there any other way to make all of this work without migrating a project to AndroidX?

like image 440
tensor Avatar asked Mar 18 '26 09:03

tensor


1 Answers

after the update you can use it like this

FirebaseAuth.instance.currentUser

instead of FirebaseAuth.instance.currentUser()

this will fix the issue

like image 105
Syed Usama Ahmad Avatar answered Mar 21 '26 00:03

Syed Usama Ahmad



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!