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