11part of 'appwrite.dart' ;
22
3-
43/// Helper class to generate query strings.
54class Query {
65 final String method;
@@ -14,11 +13,11 @@ class Query {
1413 'method' : method,
1514 };
1615
17- if (attribute != null ) {
16+ if (attribute != null ) {
1817 map['attribute' ] = attribute;
1918 }
20-
21- if (values != null ) {
19+
20+ if (values != null ) {
2221 map['values' ] = values is List ? values : [values];
2322 }
2423
@@ -29,7 +28,7 @@ class Query {
2928 String toString () => jsonEncode (toJson ());
3029
3130 /// Filter resources where [attribute] is equal to [value] .
32- ///
31+ ///
3332 /// [value] can be a single value or a list. If a list is used
3433 /// the query will return resources where [attribute] is equal
3534 /// to any of the values in the list.
@@ -61,10 +60,12 @@ class Query {
6160 Query ._('search' , attribute, value).toString ();
6261
6362 /// Filter resources where [attribute] is null.
64- static String isNull (String attribute) => Query ._('isNull' , attribute).toString ();
63+ static String isNull (String attribute) =>
64+ Query ._('isNull' , attribute).toString ();
6565
6666 /// Filter resources where [attribute] is not null.
67- static String isNotNull (String attribute) => Query ._('isNotNull' , attribute).toString ();
67+ static String isNotNull (String attribute) =>
68+ Query ._('isNotNull' , attribute).toString ();
6869
6970 /// Filter resources where [attribute] is between [start] and [end] (inclusive).
7071 static String between (String attribute, dynamic start, dynamic end) =>
@@ -84,40 +85,46 @@ class Query {
8485 Query ._('contains' , attribute, value).toString ();
8586
8687 static String or (List <String > queries) =>
87- Query ._('or' , null , queries.map ((query) => jsonDecode (query)).toList ()).toString ();
88+ Query ._('or' , null , queries.map ((query) => jsonDecode (query)).toList ())
89+ .toString ();
8890
8991 static String and (List <String > queries) =>
90- Query ._('and' , null , queries.map ((query) => jsonDecode (query)).toList ()).toString ();
92+ Query ._('and' , null , queries.map ((query) => jsonDecode (query)).toList ())
93+ .toString ();
9194
9295 /// Specify which attributes should be returned by the API call.
9396 static String select (List <String > attributes) =>
9497 Query ._('select' , null , attributes).toString ();
9598
9699 /// Sort results by [attribute] ascending.
97- static String orderAsc (String attribute) => Query ._('orderAsc' , attribute).toString ();
100+ static String orderAsc (String attribute) =>
101+ Query ._('orderAsc' , attribute).toString ();
98102
99103 /// Sort results by [attribute] descending.
100- static String orderDesc (String attribute) => Query ._('orderDesc' , attribute).toString ();
104+ static String orderDesc (String attribute) =>
105+ Query ._('orderDesc' , attribute).toString ();
101106
102107 /// Return results before [id] .
103- ///
108+ ///
104109 /// Refer to the [Cursor Based Pagination] (https://appwrite.io/docs/pagination#cursor-pagination)
105110 /// docs for more information.
106- static String cursorBefore (String id) => Query ._('cursorBefore' , null , id).toString ();
111+ static String cursorBefore (String id) =>
112+ Query ._('cursorBefore' , null , id).toString ();
107113
108114 /// Return results after [id] .
109- ///
115+ ///
110116 /// Refer to the [Cursor Based Pagination] (https://appwrite.io/docs/pagination#cursor-pagination)
111117 /// docs for more information.
112- static String cursorAfter (String id) => Query ._('cursorAfter' , null , id).toString ();
118+ static String cursorAfter (String id) =>
119+ Query ._('cursorAfter' , null , id).toString ();
113120
114121 /// Return only [limit] results.
115122 static String limit (int limit) => Query ._('limit' , null , limit).toString ();
116123
117124 /// Return results from [offset] .
118- ///
125+ ///
119126 /// Refer to the [Offset Pagination] (https://appwrite.io/docs/pagination#offset-pagination)
120127 /// docs for more information.
121- static String offset (int offset) => Query ._( 'offset' , null , offset). toString ();
122-
123- }
128+ static String offset (int offset) =>
129+ Query ._( 'offset' , null , offset). toString ();
130+ }
0 commit comments