正在寻找一些建议来进一步调试此问题。
我正在编写Flutter应用程序,并且已成功将Firestore用于许多不同的操作。但是,奇怪的是,一个非常简单的操作拒绝完成。我的await
通话中没有得到回复:
@override
Future<void> reportSnap(FeedItem item) async {
print("Adding report to database: $item");
await Firestore.instance.collection(_REPORTS).add(
{
_ReportsKey.image: item.imageName,
_ReportsKey.reported: DateTime.now(),
_ReportsKey.reporter: _user.id,
},
);
print("-> Done"); // Never printed, nothing appears in DB
}
调用此函数的代码也永远不会完成:
if (wantsToReport) {
print("Sending report to data service");
await _dataService.reportSnap(item);
print("Showing snack message..."); // never shown
_view.showSnackMessage("Thanks, we'll take a look"); // doesn't happen
}
其他数据库操作继续正常运行,这似乎排除了我免费的Firebase计划达到配额的可能性。 (我认为我距离这些配额还有很长的路要走,目前只是台式机测试而已。)
我很高兴这里没什么可做的,但这让我很困惑。有人遇到过类似的问题吗?