@@ -10,14 +10,14 @@ class Query {
1010
1111 Map <String , dynamic > toJson () {
1212 final result = < String , dynamic > {};
13-
13+
1414 result['method' ] = method;
15-
16- if (attribute != null ) {
15+
16+ if (attribute != null ) {
1717 result['attribute' ] = attribute;
1818 }
19-
20- if (values != null ) {
19+
20+ if (values != null ) {
2121 result['values' ] = values is List ? values : [values];
2222 }
2323
@@ -28,7 +28,7 @@ class Query {
2828 String toString () => jsonEncode (toJson ());
2929
3030 /// Filter resources where [attribute] is equal to [value] .
31- ///
31+ ///
3232 /// [value] can be a single value or a list. If a list is used
3333 /// the query will return resources where [attribute] is equal
3434 /// to any of the values in the list.
@@ -130,16 +130,16 @@ class Query {
130130 Query ._('updatedBetween' , null , [start, end]).toString ();
131131
132132 static String or (List <String > queries) => Query ._(
133- 'or' ,
134- null ,
135- queries.map ((query) => jsonDecode (query)).toList (),
136- ).toString ();
133+ 'or' ,
134+ null ,
135+ queries.map ((query) => jsonDecode (query)).toList (),
136+ ).toString ();
137137
138138 static String and (List <String > queries) => Query ._(
139- 'and' ,
140- null ,
141- queries.map ((query) => jsonDecode (query)).toList (),
142- ).toString ();
139+ 'and' ,
140+ null ,
141+ queries.map ((query) => jsonDecode (query)).toList (),
142+ ).toString ();
143143
144144 /// Specify which attributes should be returned by the API call.
145145 static String select (List <String > attributes) =>
@@ -154,18 +154,17 @@ class Query {
154154 Query ._('orderDesc' , attribute).toString ();
155155
156156 /// Sort results randomly.
157- static String orderRandom () =>
158- Query ._('orderRandom' ).toString ();
157+ static String orderRandom () => Query ._('orderRandom' ).toString ();
159158
160159 /// Return results before [id] .
161- ///
160+ ///
162161 /// Refer to the [Cursor Based Pagination] (https://appwrite.io/docs/pagination#cursor-pagination)
163162 /// docs for more information.
164163 static String cursorBefore (String id) =>
165164 Query ._('cursorBefore' , null , id).toString ();
166165
167166 /// Return results after [id] .
168- ///
167+ ///
169168 /// Refer to the [Cursor Based Pagination] (https://appwrite.io/docs/pagination#cursor-pagination)
170169 /// docs for more information.
171170 static String cursorAfter (String id) =>
@@ -175,27 +174,43 @@ class Query {
175174 static String limit (int limit) => Query ._('limit' , null , limit).toString ();
176175
177176 /// Return results from [offset] .
178- ///
177+ ///
179178 /// Refer to the [Offset Pagination] (https://appwrite.io/docs/pagination#offset-pagination)
180179 /// docs for more information.
181180 static String offset (int offset) =>
182181 Query ._('offset' , null , offset).toString ();
183182
184183 /// Filter resources where [attribute] is at a specific distance from the given coordinates.
185- static String distanceEqual (String attribute, List <dynamic > values, num distance, [bool meters = true ]) =>
186- Query ._('distanceEqual' , attribute, [[values, distance, meters]]).toString ();
184+ static String distanceEqual (
185+ String attribute, List <dynamic > values, num distance,
186+ [bool meters = true ]) =>
187+ Query ._('distanceEqual' , attribute, [
188+ [values, distance, meters]
189+ ]).toString ();
187190
188191 /// Filter resources where [attribute] is not at a specific distance from the given coordinates.
189- static String distanceNotEqual (String attribute, List <dynamic > values, num distance, [bool meters = true ]) =>
190- Query ._('distanceNotEqual' , attribute, [[values, distance, meters]]).toString ();
192+ static String distanceNotEqual (
193+ String attribute, List <dynamic > values, num distance,
194+ [bool meters = true ]) =>
195+ Query ._('distanceNotEqual' , attribute, [
196+ [values, distance, meters]
197+ ]).toString ();
191198
192199 /// Filter resources where [attribute] is at a distance greater than the specified value from the given coordinates.
193- static String distanceGreaterThan (String attribute, List <dynamic > values, num distance, [bool meters = true ]) =>
194- Query ._('distanceGreaterThan' , attribute, [[values, distance, meters]]).toString ();
200+ static String distanceGreaterThan (
201+ String attribute, List <dynamic > values, num distance,
202+ [bool meters = true ]) =>
203+ Query ._('distanceGreaterThan' , attribute, [
204+ [values, distance, meters]
205+ ]).toString ();
195206
196207 /// Filter resources where [attribute] is at a distance less than the specified value from the given coordinates.
197- static String distanceLessThan (String attribute, List <dynamic > values, num distance, [bool meters = true ]) =>
198- Query ._('distanceLessThan' , attribute, [[values, distance, meters]]).toString ();
208+ static String distanceLessThan (
209+ String attribute, List <dynamic > values, num distance,
210+ [bool meters = true ]) =>
211+ Query ._('distanceLessThan' , attribute, [
212+ [values, distance, meters]
213+ ]).toString ();
199214
200215 /// Filter resources where [attribute] intersects with the given geometry.
201216 static String intersects (String attribute, List <dynamic > values) =>
@@ -228,4 +243,4 @@ class Query {
228243 /// Filter resources where [attribute] does not touch the given geometry.
229244 static String notTouches (String attribute, List <dynamic > values) =>
230245 Query ._('notTouches' , attribute, [values]).toString ();
231- }
246+ }
0 commit comments