【发布时间】:2020-04-21 09:22:55
【问题描述】:
我已使用
管理离线 Firebase 数据 Firestore.instance.settings(persistenceEnabled: true);
我从What is the best way to store data from Firebase to SQLite or offline in flutter?得到了这个解决方案
但现在它工作正常,但在 firebase 操作中它不会进入下一步。 我的代码是:
showLoader();
print("2222222222222222");
DocumentReference ref = await _databaseReference
.collection(FirebaseCollection.transcation)
.add(param).catchError((onError){
hideLoader();
print("5555555 $onError");
}).then((onValue){
print("44444444444 $onValue");
});
print("33333333333");
var token = '';
var receiverId = '';
.collection(FirebaseCollection.user)
.document(userId)
.get()
.then((document) async {
UserModel userModel = UserModel.fromsnapshot(document);
print("data");
}
这里我有调试但只打印 2222222222 没有别的。 当我的设备离线时,我无法隐藏我的加载程序或执行的其他任务。
【问题讨论】:
-
添加一个 try-catch 块,如果有,请分享异常详细信息。
标签: firebase flutter dart google-cloud-firestore