【问题标题】:GetX (updated to 4.1.1) with FirebaseAuth - Flutter authentication not working带有 FirebaseAuth 的 GetX(更新到 4.1.1)- Flutter 身份验证不起作用
【发布时间】:2021-06-24 22:47:06
【问题描述】:

自更新 GetX 4.1.1 以来,我的身份验证模型已损坏。

这曾经在我的代码中工作:

class AuthenticationService extends GetxService {
    final FirebaseAuth _auth = FirebaseAuth.instance;

     Rx<User> _firebaseUser = Rx<User>();   //<--error: 1 positional argument(s) expected, but 0 found.

这里的主要问题是“Rx()”现在是一个错误。升级到 GetX 4.1.1 后如何解决此问题?

我尝试用 User().obs 替换它,但错误是:用户没有默认构造函数。

【问题讨论】:

    标签: firebase flutter dart firebase-authentication flutter-getx


    【解决方案1】:

    您可以尝试像这样更改它: Rxn _firebaseUser = Rxn (); 见https://github.com/jonataslaw/getx/issues/1241

    【讨论】:

      猜你喜欢
      • 2015-01-10
      • 1970-01-01
      • 2017-04-20
      • 2020-03-26
      • 2020-02-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-12-19
      相关资源
      最近更新 更多