You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/flutter/README.md
+172Lines changed: 172 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,6 +22,15 @@ This library gives you access to the powerful Parse Server backend from your Flu
22
22
-[Compatibility](#compatibility)
23
23
-[Handling Version Conflicts](#handling-version-conflicts)
24
24
-[Getting Started](#getting-started)
25
+
-[Features](#features)
26
+
-[Live Queries](#live-queries)
27
+
-[Offline Support](#offline-support)
28
+
-[Usage](#usage)
29
+
-[ParseLiveList](#parselivelist)
30
+
-[ParseLiveSliverList](#parselivesliverlist)
31
+
-[ParseLiveSliverGrid](#parseliveslivergrid)
32
+
-[ParseLivePageView](#parselivepageview)
33
+
-[Offline Mode](#offline-mode)
25
34
-[Documentation](#documentation)
26
35
-[Contributing](#contributing)
27
36
@@ -53,6 +62,169 @@ For detailed troubleshooting, see our [Version Conflict Guide](../../MIGRATION_G
53
62
54
63
To install, add the Parse Flutter SDK as a [dependency](https://pub.dev/packages/parse_server_sdk_flutter/install) in your `pubspec.yaml` file.
55
64
65
+
## Features
66
+
67
+
### Live Queries
68
+
69
+
The Parse Flutter SDK provides real-time data synchronization with your Parse Server through live queries. The SDK includes multiple widget types to display live data:
70
+
71
+
-**ParseLiveList**: Traditional scrollable list for displaying Parse objects
72
+
-**ParseLiveSliverList**: Sliver-based list for use within CustomScrollView
73
+
-**ParseLiveSliverGrid**: Sliver-based grid for use within CustomScrollView
74
+
-**ParseLivePageView**: PageView-based widget for swiping through objects
75
+
76
+
All live query widgets support:
77
+
- Real-time updates via live query subscriptions
78
+
- Pagination for handling large datasets
79
+
- Lazy loading for efficient memory usage
80
+
- Customizable child builders for flexible UI design
81
+
- Error handling and loading states
82
+
83
+
### Offline Support
84
+
85
+
The Parse Flutter SDK includes comprehensive offline support through local caching. When enabled, the app can:
86
+
87
+
- Cache Parse objects locally for offline access
88
+
- Automatically sync cached objects when connectivity is restored
89
+
- Provide seamless user experience even without network connection
90
+
- Efficiently manage disk storage with LRU caching
91
+
92
+
## Usage
93
+
94
+
### ParseLiveList
95
+
96
+
A traditional ListView widget that displays a live-updating list of Parse objects:
97
+
98
+
```dart
99
+
ParseLiveListWidget<MyObject>(
100
+
query: QueryBuilder<MyObject>(MyObject()),
101
+
childBuilder: (context, snapshot) {
102
+
if (snapshot.hasData) {
103
+
return ListTile(title: Text(snapshot.data.name));
104
+
}
105
+
return const ListTile(title: Text('Loading...'));
106
+
},
107
+
offlineMode: true,
108
+
fromJson: (json) => MyObject().fromJson(json),
109
+
)
110
+
```
111
+
112
+
### ParseLiveSliverList
113
+
114
+
A sliver-based list widget for use within CustomScrollView:
115
+
116
+
```dart
117
+
CustomScrollView(
118
+
slivers: [
119
+
SliverAppBar(title: const Text('Live List')),
120
+
ParseLiveSliverListWidget<MyObject>(
121
+
query: QueryBuilder<MyObject>(MyObject()),
122
+
childBuilder: (context, snapshot) {
123
+
if (snapshot.hasData) {
124
+
return ListTile(title: Text(snapshot.data.name));
125
+
}
126
+
return const ListTile(title: Text('Loading...'));
127
+
},
128
+
offlineMode: true,
129
+
fromJson: (json) => MyObject().fromJson(json),
130
+
),
131
+
],
132
+
)
133
+
```
134
+
135
+
### ParseLiveSliverGrid
136
+
137
+
A sliver-based grid widget for use within CustomScrollView:
138
+
139
+
```dart
140
+
CustomScrollView(
141
+
slivers: [
142
+
SliverAppBar(title: const Text('Live Grid')),
143
+
ParseLiveSliverGridWidget<MyObject>(
144
+
query: QueryBuilder<MyObject>(MyObject()),
145
+
crossAxisCount: 2,
146
+
childBuilder: (context, snapshot) {
147
+
if (snapshot.hasData) {
148
+
return Card(child: Text(snapshot.data.name));
149
+
}
150
+
return const Card(child: Text('Loading...'));
151
+
},
152
+
offlineMode: true,
153
+
fromJson: (json) => MyObject().fromJson(json),
154
+
),
155
+
],
156
+
)
157
+
```
158
+
159
+
### ParseLivePageView
160
+
161
+
A PageView widget for swiping through Parse objects:
162
+
163
+
```dart
164
+
ParseLiveListPageView<MyObject>(
165
+
query: QueryBuilder<MyObject>(MyObject()),
166
+
childBuilder: (context, snapshot) {
167
+
if (snapshot.hasData) {
168
+
return Center(child: Text(snapshot.data.name));
169
+
}
170
+
return const Center(child: Text('Loading...'));
171
+
},
172
+
pagination: true,
173
+
pageSize: 1,
174
+
offlineMode: true,
175
+
fromJson: (json) => MyObject().fromJson(json),
176
+
)
177
+
```
178
+
179
+
### Offline Mode
180
+
181
+
Enable offline support on any live query widget by setting `offlineMode: true`. The widget will automatically cache data and switch to cached data when offline.
182
+
183
+
#### Offline Caching Methods
184
+
185
+
Use the `ParseObjectOffline` extension methods for manual offline control:
186
+
187
+
```dart
188
+
// Save a single object to cache
189
+
await myObject.saveToLocalCache();
190
+
191
+
// Load a single object from cache
192
+
final cachedObject = await ParseObjectOffline.loadFromLocalCache('ClassName', 'objectId');
0 commit comments