11part of '{{ language .params .packageName }}.dart';
22
3-
43/// Helper class to generate query strings.
54class Query {
65 final String method;
@@ -10,9 +9,7 @@ class Query {
109 Query._(this.method, [this.attribute = null, this.values = null]);
1110
1211 Map<String , dynamic > toJson() {
13- final map = <String , dynamic >{
14- 'method': method,
15- };
12+ final map = <String , dynamic >{'method': method};
1613
1714 if(attribute != null) {
1815 map['attribute'] = attribute;
@@ -61,10 +58,12 @@ class Query {
6158 Query._('search', attribute, value).toString();
6259
6360 /// Filter resources where [attribute] is null.
64- static String isNull(String attribute) => Query._('isNull', attribute).toString();
61+ static String isNull(String attribute) =>
62+ Query._('isNull', attribute).toString();
6563
6664 /// Filter resources where [attribute] is not null.
67- static String isNotNull(String attribute) => Query._('isNotNull', attribute).toString();
65+ static String isNotNull(String attribute) =>
66+ Query._('isNotNull', attribute).toString();
6867
6968 /// Filter resources where [attribute] is between [start] and [end] (inclusive).
7069 static String between(String attribute, dynamic start, dynamic end) =>
@@ -105,44 +104,58 @@ class Query {
105104 Query._('notEndsWith', attribute, value).toString();
106105
107106 /// Filter resources where document was created before [value].
108- static String createdBefore(String value) => Query._('createdBefore', null, value).toString();
107+ static String createdBefore(String value) =>
108+ Query._('createdBefore', null, value).toString();
109109
110110 /// Filter resources where document was created after [value].
111- static String createdAfter(String value) => Query._('createdAfter', null, value).toString();
111+ static String createdAfter(String value) =>
112+ Query._('createdAfter', null, value).toString();
112113
113114 /// Filter resources where document was updated before [value].
114- static String updatedBefore(String value) => Query._('updatedBefore', null, value).toString();
115+ static String updatedBefore(String value) =>
116+ Query._('updatedBefore', null, value).toString();
115117
116118 /// Filter resources where document was updated after [value].
117- static String updatedAfter(String value) => Query._('updatedAfter', null, value).toString();
119+ static String updatedAfter(String value) =>
120+ Query._('updatedAfter', null, value).toString();
118121
119- static String or(List<String > queries) =>
120- Query._('or', null, queries.map((query) => jsonDecode(query)).toList()).toString();
122+ static String or(List<String > queries) => Query._(
123+ 'or',
124+ null,
125+ queries.map((query) => jsonDecode(query)).toList(),
126+ ).toString();
121127
122- static String and(List<String > queries) =>
123- Query._('and', null, queries.map((query) => jsonDecode(query)).toList()).toString();
128+ static String and(List<String > queries) => Query._(
129+ 'and',
130+ null,
131+ queries.map((query) => jsonDecode(query)).toList(),
132+ ).toString();
124133
125134 /// Specify which attributes should be returned by the API call.
126135 static String select(List<String > attributes) =>
127136 Query._('select', null, attributes).toString();
128137
129138 /// Sort results by [attribute] ascending.
130- static String orderAsc(String attribute) => Query._('orderAsc', attribute).toString();
139+ static String orderAsc(String attribute) =>
140+ Query._('orderAsc', attribute).toString();
131141
132142 /// Sort results by [attribute] descending.
133- static String orderDesc(String attribute) => Query._('orderDesc', attribute).toString();
143+ static String orderDesc(String attribute) =>
144+ Query._('orderDesc', attribute).toString();
134145
135146 /// Return results before [id].
136147 ///
137148 /// Refer to the [Cursor Based Pagination]({{sdk .url }}/docs/pagination#cursor-pagination)
138149 /// docs for more information.
139- static String cursorBefore(String id) => Query._('cursorBefore', null, id).toString();
150+ static String cursorBefore(String id) =>
151+ Query._('cursorBefore', null, id).toString();
140152
141153 /// Return results after [id].
142154 ///
143155 /// Refer to the [Cursor Based Pagination]({{sdk .url }}/docs/pagination#cursor-pagination)
144156 /// docs for more information.
145- static String cursorAfter(String id) => Query._('cursorAfter', null, id).toString();
157+ static String cursorAfter(String id) =>
158+ Query._('cursorAfter', null, id).toString();
146159
147160 /// Return only [limit] results.
148161 static String limit(int limit) => Query._('limit', null, limit).toString();
@@ -151,6 +164,6 @@ class Query {
151164 ///
152165 /// Refer to the [Offset Pagination]({{sdk .url }}/docs/pagination#offset-pagination)
153166 /// docs for more information.
154- static String offset(int offset) => Query._('offset', null, offset).toString();
155-
167+ static String offset(int offset) =>
168+ Query._('offset', null, offset).toString();
156169}
0 commit comments