Search code examples
androidfirebaseflutterflutter-getx

How to declare a reactive firebase user using getx package


I want to declare a FirebaseUser (from the firebase_auth package), in a reactive way.

Rx<FirebaseUser> firebaseUser = Rx<FirebaseUser>();

But Rx<FirebaseUser>() give me the error

"1 positional argument(s) expected, but 0 found".

Any work around ?


Solution

  • Are you using a null safety version of GetX?

    If so, this is probably what you're looking for:

    Rxn<User> firebaseUser = Rxn<User>();