@@ -698,6 +698,16 @@ class FirestoreSnippets extends DocSnippet {
698
698
// [END perform_simple_and_compound_queries_array_contains_any]
699
699
}
700
700
701
+ void performSimpleAndCompoundQueries_inArray () {
702
+ // [START perform_simple_and_compound_queries_array_wherein]
703
+ final citiesRef = db.collection ("cities" );
704
+ final cities = citiesRef.where ("regions" , whereIn: [
705
+ ["west_coast" ],
706
+ ["east_coast" ]
707
+ ]);
708
+ // [END perform_simple_and_compound_queries_array_wherein]
709
+ }
710
+
701
711
void performSimpleAndCompoundQueries_compoundQueries () {
702
712
// [START perform_simple_and_compound_queries_compound_queries]
703
713
final citiesRef = db.collection ("cities" );
@@ -901,6 +911,25 @@ class FirestoreSnippets extends DocSnippet {
901
911
// [END paginate_data_set_cursor_based_on_multiple_fields]
902
912
}
903
913
914
+ void accessDataOffline_configure () {
915
+ // [START access_data_offline_configure_offline_persistence]
916
+ // Apple and Android
917
+ db.settings = const Settings (persistenceEnabled: true );
918
+
919
+ // Web
920
+ await db.enablePersistence (const PersistenceSettings (synchronizeTabs: true ));
921
+ // [END access_data_offline_configure_offline_persistence]
922
+ }
923
+
924
+ void accessDataOffline_configureCache () {
925
+ // [START access_data_offline_configure_cache_size]
926
+ db.settings = const Settings (
927
+ persistenceEnabled: true ,
928
+ cacheSizeBytes: Settings .CACHE_SIZE_UNLIMITED ,
929
+ );
930
+ // [END access_data_offline_configure_cache_size]
931
+ }
932
+
904
933
void accessDataOffline_listenToOfflineData () {
905
934
// [START access_data_offline_listen_to_offline_data]
906
935
db
@@ -930,8 +959,8 @@ class FirestoreSnippets extends DocSnippet {
930
959
931
960
void accessDataOffline_enableNetwork () {
932
961
// [START access_data_offline_enable_network]
933
- db.disableNetwork ().then ((_) {
934
- // Do offline things
962
+ db.enableNetwork ().then ((_) {
963
+ // Back online
935
964
});
936
965
// [END access_data_offline_enable_network]
937
966
}
0 commit comments