Flutter Firestore重置缓存 [英] Flutter Firestore reset cache

查看:32
本文介绍了Flutter Firestore重置缓存的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

目前,我有来自手机缓存的文档快照.我从

At the moment I have document snapshots that are coming from my phone's cache. I know this from

print(document.metadata.isFromCache ? "NOT FROM NETWORK" : "FROM NETWORK");// document is a DocumentSnapshot

颤振:不是来自网络

flutter: NOT FROM NETWORK

但是,我已从Firestore删除了其中的一些文档,但它们仍在显示.我想知道是否有一种方法可以在扑朔迷离中为Firestore重置缓存,以便所有文档都来自云.

However I have deleted some of these documents off firestore, but they are still appearing. I would like to know if there is a way in which I can reset my cache for firestore in flutter so that all the documents are from the cloud.

感谢您的帮助-非常感谢.

Thanks for any help - much appreciated.

推荐答案

如果文档显示在查询中,其中源文档已被删除,如果应用程序具有连接性并且可以与之同步,这听起来像是个错误.消防站.如果您可以通过特定步骤重现这种情况,则Firestore团队可能需要您的错误报告

It sounds like a bug if a document shows up in a query where the source document has been deleted, if the app has connectivity and can synchronize with Firestore. If you can reproduce this situation with specific steps, the Firestore team might want your bug report.

如果您只想从干净的缓存开始进行开发,则可以卸载并重新安装该应用以清除缓存.

If you just want to start with a clean cache for development, you can uninstall and reinstall the app to clear the cache.

在Android上,有一个系统选项可让您清除应用数据(也可能有类似的iOS选项).

On Android, there is a system option where you can clear app data (there might be a similar iOS option as well).

这篇关于Flutter Firestore重置缓存的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆