@@ -10,14 +10,14 @@ class Query {
10
10
11
11
Map <String , dynamic > toJson () {
12
12
final result = < String , dynamic > {};
13
-
13
+
14
14
result['method' ] = method;
15
-
16
- if (attribute != null ) {
15
+
16
+ if (attribute != null ) {
17
17
result['attribute' ] = attribute;
18
18
}
19
-
20
- if (values != null ) {
19
+
20
+ if (values != null ) {
21
21
result['values' ] = values is List ? values : [values];
22
22
}
23
23
@@ -28,7 +28,7 @@ class Query {
28
28
String toString () => jsonEncode (toJson ());
29
29
30
30
/// Filter resources where [attribute] is equal to [value] .
31
- ///
31
+ ///
32
32
/// [value] can be a single value or a list. If a list is used
33
33
/// the query will return resources where [attribute] is equal
34
34
/// to any of the values in the list.
@@ -154,14 +154,14 @@ class Query {
154
154
Query ._('orderDesc' , attribute).toString ();
155
155
156
156
/// Return results before [id] .
157
- ///
157
+ ///
158
158
/// Refer to the [Cursor Based Pagination] (https://appwrite.io/docs/pagination#cursor-pagination)
159
159
/// docs for more information.
160
160
static String cursorBefore (String id) =>
161
161
Query ._('cursorBefore' , null , id).toString ();
162
162
163
163
/// Return results after [id] .
164
- ///
164
+ ///
165
165
/// Refer to the [Cursor Based Pagination] (https://appwrite.io/docs/pagination#cursor-pagination)
166
166
/// docs for more information.
167
167
static String cursorAfter (String id) =>
@@ -171,51 +171,27 @@ class Query {
171
171
static String limit (int limit) => Query ._('limit' , null , limit).toString ();
172
172
173
173
/// Return results from [offset] .
174
- ///
174
+ ///
175
175
/// Refer to the [Offset Pagination] (https://appwrite.io/docs/pagination#offset-pagination)
176
176
/// docs for more information.
177
177
static String offset (int offset) =>
178
178
Query ._('offset' , null , offset).toString ();
179
179
180
180
/// Filter resources where [attribute] is at a specific distance from the given coordinates.
181
- static String distanceEqual (
182
- String attribute,
183
- List <dynamic > values,
184
- num distance, [
185
- bool meters = true ,
186
- ]) => Query ._('distanceEqual' , attribute, [
187
- [values, distance, meters],
188
- ]).toString ();
181
+ static String distanceEqual (String attribute, List <dynamic > values, num distance, [bool meters = true ]) =>
182
+ Query ._('distanceEqual' , attribute, [[values, distance, meters]]).toString ();
189
183
190
184
/// Filter resources where [attribute] is not at a specific distance from the given coordinates.
191
- static String distanceNotEqual (
192
- String attribute,
193
- List <dynamic > values,
194
- num distance, [
195
- bool meters = true ,
196
- ]) => Query ._('distanceNotEqual' , attribute, [
197
- [values, distance, meters],
198
- ]).toString ();
185
+ static String distanceNotEqual (String attribute, List <dynamic > values, num distance, [bool meters = true ]) =>
186
+ Query ._('distanceNotEqual' , attribute, [[values, distance, meters]]).toString ();
199
187
200
188
/// Filter resources where [attribute] is at a distance greater than the specified value from the given coordinates.
201
- static String distanceGreaterThan (
202
- String attribute,
203
- List <dynamic > values,
204
- num distance, [
205
- bool meters = true ,
206
- ]) => Query ._('distanceGreaterThan' , attribute, [
207
- [values, distance, meters],
208
- ]).toString ();
189
+ static String distanceGreaterThan (String attribute, List <dynamic > values, num distance, [bool meters = true ]) =>
190
+ Query ._('distanceGreaterThan' , attribute, [[values, distance, meters]]).toString ();
209
191
210
192
/// Filter resources where [attribute] is at a distance less than the specified value from the given coordinates.
211
- static String distanceLessThan (
212
- String attribute,
213
- List <dynamic > values,
214
- num distance, [
215
- bool meters = true ,
216
- ]) => Query ._('distanceLessThan' , attribute, [
217
- [values, distance, meters],
218
- ]).toString ();
193
+ static String distanceLessThan (String attribute, List <dynamic > values, num distance, [bool meters = true ]) =>
194
+ Query ._('distanceLessThan' , attribute, [[values, distance, meters]]).toString ();
219
195
220
196
/// Filter resources where [attribute] intersects with the given geometry.
221
197
static String intersects (String attribute, List <dynamic > values) =>
@@ -248,4 +224,4 @@ class Query {
248
224
/// Filter resources where [attribute] does not touch the given geometry.
249
225
static String notTouches (String attribute, List <dynamic > values) =>
250
226
Query ._('notTouches' , attribute, [values]).toString ();
251
- }
227
+ }
0 commit comments