@@ -18,7 +18,7 @@ class QueryBuilder<T extends ParseObject> {
1818 query += '{' + list[i].buildQueries (list[i].queries) + '}' ;
1919 }
2020 query += ']' ;
21- queries.add (MapEntry <String , dynamic >(_NO_OPERATOR_NEEDED , query));
21+ queries.add (MapEntry <String , dynamic >(_noOperatorNeeded , query));
2222 }
2323
2424 factory QueryBuilder .copy (QueryBuilder <T > query) {
@@ -32,8 +32,8 @@ class QueryBuilder<T extends ParseObject> {
3232 return copy;
3333 }
3434
35- static const String _NO_OPERATOR_NEEDED = 'NO_OP' ;
36- static const String _SINGLE_QUERY = 'SINGLE_QUERY' ;
35+ static const String _noOperatorNeeded = 'NO_OP' ;
36+ static const String _singleQuery = 'SINGLE_QUERY' ;
3737
3838 T object;
3939 List <MapEntry <String , dynamic >> queries = < MapEntry <String , dynamic >> [];
@@ -103,10 +103,10 @@ class QueryBuilder<T extends ParseObject> {
103103 {bool caseSensitive = false }) {
104104 if (caseSensitive) {
105105 queries.add (MapEntry <String , dynamic >(
106- _SINGLE_QUERY , '"$column ":{"\$ regex": "^$query "}' ));
106+ _singleQuery , '"$column ":{"\$ regex": "^$query "}' ));
107107 } else {
108108 queries.add (MapEntry <String , dynamic >(
109- _SINGLE_QUERY , '"$column ":{"\$ regex": "^$query ", "\$ options": "i"}' ));
109+ _singleQuery , '"$column ":{"\$ regex": "^$query ", "\$ options": "i"}' ));
110110 }
111111 }
112112
@@ -115,17 +115,17 @@ class QueryBuilder<T extends ParseObject> {
115115 {bool caseSensitive = false }) {
116116 if (caseSensitive) {
117117 queries.add (MapEntry <String , dynamic >(
118- _SINGLE_QUERY , '"$column ":{"\$ regex": "$query \$ "}' ));
118+ _singleQuery , '"$column ":{"\$ regex": "$query \$ "}' ));
119119 } else {
120- queries.add (MapEntry <String , dynamic >(_SINGLE_QUERY ,
121- '"$column ":{"\$ regex": "$query \$ ", "\$ options": "i"}' ));
120+ queries.add (MapEntry <String , dynamic >(
121+ _singleQuery, '"$column ":{"\$ regex": "$query \$ ", "\$ options": "i"}' ));
122122 }
123123 }
124124
125125 /// Returns an object where the [String] column equals [value]
126126 void whereEqualTo (String column, dynamic value) {
127127 queries.add (_buildQueryWithColumnValueAndOperator (
128- MapEntry <String , dynamic >(column, value), _NO_OPERATOR_NEEDED ));
128+ MapEntry <String , dynamic >(column, value), _noOperatorNeeded ));
129129 }
130130
131131 /// Returns an object where the [String] column contains a value less than
@@ -182,7 +182,7 @@ class QueryBuilder<T extends ParseObject> {
182182
183183 /// Retrieves related objets where [String] column is a relation field to the class [String] className
184184 void whereRelatedTo (String column, String className, String objectId) {
185- queries.add (MapEntry <String , dynamic >(_SINGLE_QUERY ,
185+ queries.add (MapEntry <String , dynamic >(_singleQuery ,
186186 '"\$ relatedTo":{"object":{"__type":"Pointer","className":"$className ","objectId":"$objectId "},"key":"$column "}' ));
187187 }
188188
@@ -216,20 +216,20 @@ class QueryBuilder<T extends ParseObject> {
216216 {bool caseSensitive = false }) {
217217 if (caseSensitive) {
218218 queries.add (MapEntry <String , dynamic >(
219- _SINGLE_QUERY , '"$column ":{"\$ regex": "$value "}' ));
219+ _singleQuery , '"$column ":{"\$ regex": "$value "}' ));
220220 } else {
221221 queries.add (MapEntry <String , dynamic >(
222- _SINGLE_QUERY , '"$column ":{"\$ regex": "$value ", "\$ options": "i"}' ));
222+ _singleQuery , '"$column ":{"\$ regex": "$value ", "\$ options": "i"}' ));
223223 }
224224 }
225225
226- /// Powerful search for containing whole words. This search is much quicker than regex and can search for whole words including wether they are case sensitive or not.
226+ /// Powerful search for containing whole words. This search is much quicker than regex and can search for whole words including whether they are case sensitive or not.
227227 /// This search can also order by the score of the search
228228 void whereContainsWholeWord (String column, String query,
229229 {bool caseSensitive = false ,
230230 bool orderByScore = true ,
231231 bool diacriticSensitive = false }) {
232- queries.add (MapEntry <String , dynamic >(_SINGLE_QUERY ,
232+ queries.add (MapEntry <String , dynamic >(_singleQuery ,
233233 '"$column ":{"\$ text":{"\$ search":{"\$ term": "$query ", "\$ caseSensitive": $caseSensitive , "\$ diacriticSensitive": $diacriticSensitive }}}' ));
234234 if (orderByScore) {
235235 orderByAscending ('\$ score' );
@@ -241,7 +241,7 @@ class QueryBuilder<T extends ParseObject> {
241241 void whereNear (String column, ParseGeoPoint point) {
242242 final double latitude = point.latitude;
243243 final double longitude = point.longitude;
244- queries.add (MapEntry <String , dynamic >(_SINGLE_QUERY ,
244+ queries.add (MapEntry <String , dynamic >(_singleQuery ,
245245 '"$column ":{"\$ nearSphere":{"__type":"GeoPoint","latitude":$latitude ,"longitude":$longitude }}' ));
246246 }
247247
@@ -251,7 +251,7 @@ class QueryBuilder<T extends ParseObject> {
251251 final double latitude = point.latitude;
252252 final double longitude = point.longitude;
253253
254- queries.add (MapEntry <String , dynamic >(_SINGLE_QUERY ,
254+ queries.add (MapEntry <String , dynamic >(_singleQuery ,
255255 '"$column ":{"\$ nearSphere":{"__type":"GeoPoint","latitude":$latitude ,"longitude":$longitude },"\$ maxDistanceInMiles":$maxDistance }' ));
256256 }
257257
@@ -261,7 +261,7 @@ class QueryBuilder<T extends ParseObject> {
261261 final double latitude = point.latitude;
262262 final double longitude = point.longitude;
263263
264- queries.add (MapEntry <String , dynamic >(_SINGLE_QUERY ,
264+ queries.add (MapEntry <String , dynamic >(_singleQuery ,
265265 '"$column ":{"\$ nearSphere":{"__type":"GeoPoint","latitude":$latitude ,"longitude":$longitude },"\$ maxDistanceInKilometers":$maxDistance }' ));
266266 }
267267
@@ -271,7 +271,7 @@ class QueryBuilder<T extends ParseObject> {
271271 final double latitude = point.latitude;
272272 final double longitude = point.longitude;
273273
274- queries.add (MapEntry <String , dynamic >(_SINGLE_QUERY ,
274+ queries.add (MapEntry <String , dynamic >(_singleQuery ,
275275 '"$column ":{"\$ nearSphere":{"__type":"GeoPoint","latitude":$latitude ,"longitude":$longitude },"\$ maxDistanceInRadians":$maxDistance }' ));
276276 }
277277
@@ -284,7 +284,7 @@ class QueryBuilder<T extends ParseObject> {
284284 final double latitudeN = northeast.latitude;
285285 final double longitudeN = northeast.longitude;
286286
287- queries.add (MapEntry <String , dynamic >(_SINGLE_QUERY ,
287+ queries.add (MapEntry <String , dynamic >(_singleQuery ,
288288 '"$column ":{"\$ within":{"\$ box": [{"__type": "GeoPoint","latitude":$latitudeS ,"longitude":$longitudeS },{"__type": "GeoPoint","latitude":$latitudeN ,"longitude":$longitudeN }]}}' ));
289289 }
290290
@@ -299,7 +299,7 @@ class QueryBuilder<T extends ParseObject> {
299299 dictionary['\$ polygon' ] = points.map ((e) => e.toJson ()).toList ();
300300
301301 queries.add (MapEntry <String , dynamic >(
302- _SINGLE_QUERY , '"$column ":{"\$ geoWithin":${jsonEncode (dictionary )}}' ));
302+ _singleQuery , '"$column ":{"\$ geoWithin":${jsonEncode (dictionary )}}' ));
303303 }
304304
305305 /// Add a constraint to the query that requires a particular key's value match another QueryBuilder
@@ -309,7 +309,7 @@ class QueryBuilder<T extends ParseObject> {
309309 query._buildQueryRelational (query.object.parseClassName);
310310
311311 queries.add (MapEntry <String , dynamic >(
312- _SINGLE_QUERY , '"$column ":{"\$ inQuery":$inQuery }' ));
312+ _singleQuery , '"$column ":{"\$ inQuery":$inQuery }' ));
313313 }
314314
315315 ///Add a constraint to the query that requires a particular key's value does not match another QueryBuilder
@@ -319,7 +319,7 @@ class QueryBuilder<T extends ParseObject> {
319319 query._buildQueryRelational (query.object.parseClassName);
320320
321321 queries.add (MapEntry <String , dynamic >(
322- _SINGLE_QUERY , '"$column ":{"\$ notInQuery":$inQuery }' ));
322+ _singleQuery , '"$column ":{"\$ notInQuery":$inQuery }' ));
323323 }
324324
325325 /// Add a constraint to the query that requires a particular key's value matches a value for a key in the results of another ParseQuery.
@@ -339,7 +339,7 @@ class QueryBuilder<T extends ParseObject> {
339339 query._buildQueryRelationalKey (query.object.parseClassName, keyInQuery);
340340
341341 queries.add (MapEntry <String , dynamic >(
342- _SINGLE_QUERY , '"$column ":{"\$ select":$inQuery }' ));
342+ _singleQuery , '"$column ":{"\$ select":$inQuery }' ));
343343 }
344344
345345 /// Add a constraint to the query that requires a particular key's value does not match any value for a key in the results of another ParseQuery
@@ -359,7 +359,7 @@ class QueryBuilder<T extends ParseObject> {
359359 query._buildQueryRelationalKey (query.object.parseClassName, keyInQuery);
360360
361361 queries.add (MapEntry <String , dynamic >(
362- _SINGLE_QUERY , '"$column ":{"\$ dontSelect":$inQuery }' ));
362+ _singleQuery , '"$column ":{"\$ dontSelect":$inQuery }' ));
363363 }
364364
365365 /// Finishes the query and calls the server
@@ -445,9 +445,9 @@ class QueryBuilder<T extends ParseObject> {
445445 final dynamic value =
446446 convertValueToCorrectType (parseEncode (columnAndValue.value));
447447
448- if (queryOperator == _NO_OPERATOR_NEEDED ) {
448+ if (queryOperator == _noOperatorNeeded ) {
449449 return MapEntry <String , dynamic >(
450- _NO_OPERATOR_NEEDED , '"$key ": ${jsonEncode (value )}' );
450+ _noOperatorNeeded , '"$key ": ${jsonEncode (value )}' );
451451 } else {
452452 String queryString = '"$key ":' ;
453453 final Map <String , dynamic > queryOperatorAndValueMap = < String , dynamic > {};
@@ -470,15 +470,15 @@ class QueryBuilder<T extends ParseObject> {
470470 // Run through each query
471471 for (final MapEntry <String , dynamic > query in queries) {
472472 // Add queries that don't need sanitizing
473- if (query.key == _NO_OPERATOR_NEEDED || query.key == _SINGLE_QUERY ) {
473+ if (query.key == _noOperatorNeeded || query.key == _singleQuery ) {
474474 sanitizedQueries
475- .add (MapEntry <String , dynamic >(_NO_OPERATOR_NEEDED , query.value));
475+ .add (MapEntry <String , dynamic >(_noOperatorNeeded , query.value));
476476 }
477477
478478 // Check if query with same column name has been sanitized
479479 if (! keysAlreadyCompacted.contains (query.key) &&
480- query.key != _NO_OPERATOR_NEEDED &&
481- query.key != _SINGLE_QUERY ) {
480+ query.key != _noOperatorNeeded &&
481+ query.key != _singleQuery ) {
482482 // If not, check that it now has
483483 keysAlreadyCompacted.add (query.key);
484484
0 commit comments