更新时间:2023-09-08 14:23:46
是希望为某人省去一些麻烦.我发现问题出在没有新的Firebase数据库实例.我在main.dart中创建了实例,并将其传递给构造函数中的HomePage(根据库中的示例文件).
In the hope of saving someone a headache. I found the problem to be not getting a fresh instance of the Firebase Database. I created the instance in my main.dart and passed it to my HomePage in the constructor (per the example file in the library).
当我得到一个新实例时,经过了无奈的调试……它起作用了.现在,我可以进行匿名登录,以便只有安装了该应用程序的用户才能写入数据库.
When I got a fresh instance ...out of desperation debugging...it worked. I can now have anonymous login so that only people who have installed the app can write to the database.