1

So My problem is i want to use firebase authenticate in my app and i am trying to use this command ( Future currentUser();) but the program not recognize the word FirebseUser ? so how can i fix this ?enter image description here

2 Answers2

0

it is not a future function anymore, you can access the user directly; FirebaseAuth.instance.currentUser

Mehmet Ali Bayram
  • 7,222
  • 2
  • 22
  • 27
0

Due to the breaking changes on the firebase packages. The currentUser() is changed to the getter BREAKING: Accessing the current user via currentUser() is now synchronous via the currentUser getter. https://pub.dev/packages/firebase_auth/changelog

so you can access the current user by using the getter method.

FirebaseAuth.instance.currentUser;
Khadga shrestha
  • 1,120
  • 6
  • 11