To reduce my document reads, I want to read firestore data from the cache:
result = await FirebaseFirestore.instance
.collection(
'path/toDocument')
.get(cacheAvailable ? GetOptions(source: Source.cache));
This works. But if there doesn't exist cache data, how can I get an bool e.g cacheAvailable, to check if there exists the cache data or not?