diff --git a/lib/src/network/parse_live_query.dart b/lib/src/network/parse_live_query.dart index 066920f8b..ef8161d13 100644 --- a/lib/src/network/parse_live_query.dart +++ b/lib/src/network/parse_live_query.dart @@ -47,7 +47,7 @@ class LiveQuery { } final String _className = query.object.className; - query.limiters.clear(); //Remove limites in LiveQuery + query.limiters.clear(); //Remove limits in LiveQuery final String _where = query._buildQuery().replaceAll('where=', ''); //Convert where condition to Map Map _whereMap = Map(); @@ -74,7 +74,7 @@ class LiveQuery { _channel = IOWebSocketChannel(_webSocket); _channel.stream.listen((dynamic message) { if (_debug) { - print('$_printConstLiveQuery: Listen: ${message}'); + print('$_printConstLiveQuery: Listen: $message'); } final Map actionData = jsonDecode(message); @@ -167,7 +167,7 @@ class LiveQuery { print( '$_printConstLiveQuery: UnsubscribeMessage: $_unsubscribeMessage'); } - await _channel.sink.add(jsonEncode(_unsubscribeMessage)); + _channel.sink.add(jsonEncode(_unsubscribeMessage)); await _channel.sink.close(); } } diff --git a/lib/src/network/parse_query.dart b/lib/src/network/parse_query.dart index d32a5c1ea..b352b9a29 100644 --- a/lib/src/network/parse_query.dart +++ b/lib/src/network/parse_query.dart @@ -239,7 +239,7 @@ class QueryBuilder { // Add a constraint to the query that requires a particular key's value match another QueryBuilder void whereMatchesQuery(String column, QueryBuilder query) { - String inQuery = query._buildQueryRelational(query.object.className); + final String inQuery = query._buildQueryRelational(query.object.className); queries.add(MapEntry( _SINGLE_QUERY, '\"$column\":{\"\$inQuery\":$inQuery}')); @@ -247,7 +247,7 @@ class QueryBuilder { //Add a constraint to the query that requires a particular key's value does not match another QueryBuilder void whereDoesNotMatchQuery(String column, QueryBuilder query) { - String inQuery = query._buildQueryRelational(query.object.className); + final String inQuery = query._buildQueryRelational(query.object.className); queries.add(MapEntry( _SINGLE_QUERY, '\"$column\":{\"\$notInQuery\":$inQuery}')); @@ -371,9 +371,9 @@ class QueryBuilder { // Compact all the queries in the correct format for (MapEntry queryToCompact in listOfQueriesCompact) { var queryToCompactValue = queryToCompact.value.toString(); - queryToCompactValue = queryToCompactValue.replaceFirst("{", ""); + queryToCompactValue = queryToCompactValue.replaceFirst('{', ''); queryToCompactValue = queryToCompactValue.replaceRange( - queryToCompactValue.length - 1, queryToCompactValue.length, ""); + queryToCompactValue.length - 1, queryToCompactValue.length, ''); if (listOfQueriesCompact.first == queryToCompact) { queryEnd += queryToCompactValue.replaceAll(queryStart, ' '); } else { diff --git a/lib/src/objects/parse_acl.dart b/lib/src/objects/parse_acl.dart index 2d3ff2e5e..9e74918bf 100644 --- a/lib/src/objects/parse_acl.dart +++ b/lib/src/objects/parse_acl.dart @@ -1,7 +1,7 @@ part of flutter_parse_sdk; /// [ParseACL] is used to control which users can access or modify a particular object -/// [ParseObject] can have its own [ParceACL] +/// [ParseObject] can have its own [ParseACL] /// You can grant read and write permissions separately to specific users /// or you can grant permissions to "the public" so that, for example, any user could read a particular object but /// only a particular set of users could write to that object @@ -125,8 +125,8 @@ class _ACLPermissions { _ACLPermissions(this._readPermission, this._writePermission); final String _keyReadPermission = 'read'; final String _keyWritePermission = 'write'; - bool _readPermission = false; - bool _writePermission = false; + final bool _readPermission; + final bool _writePermission; bool getReadPermission() { return _readPermission; diff --git a/lib/src/objects/parse_installation.dart b/lib/src/objects/parse_installation.dart index 008ed79f6..f26330170 100644 --- a/lib/src/objects/parse_installation.dart +++ b/lib/src/objects/parse_installation.dart @@ -199,13 +199,15 @@ class ParseInstallation extends ParseObject { ///Subscribes the device to a channel of push notifications. void subscribeToChannel(String value) { final List channel = [value]; - addUnique('channels', channel); + setAddUnique('channels', channel); + save(); } ///Unsubscribes the device to a channel of push notifications. void unsubscribeFromChannel(String value) { final List channel = [value]; - removeAll('channels', channel); + setRemove('channels', channel); + save(); } ///Returns an > containing all the channel names this device is subscribed to. diff --git a/lib/src/objects/parse_object.dart b/lib/src/objects/parse_object.dart index 6b474fb9a..80f3ac00f 100644 --- a/lib/src/objects/parse_object.dart +++ b/lib/src/objects/parse_object.dart @@ -74,7 +74,7 @@ class ParseObject extends ParseBase implements ParseCloneable { final Map map = json.decode(result.body); objectId = map['objectId'].toString(); } - + return handleResponse( this, result, ParseApiRQ.create, _debug, className); } on Exception catch (e) { diff --git a/lib/src/objects/response/parse_response_builder.dart b/lib/src/objects/response/parse_response_builder.dart index 76b77d6c8..699360c0f 100644 --- a/lib/src/objects/response/parse_response_builder.dart +++ b/lib/src/objects/response/parse_response_builder.dart @@ -113,6 +113,6 @@ class _ParseResponseBuilder { } bool isHealthCheck(Response apiResponse) { - return apiResponse.body == "{\"status\":\"ok\"}"; + return apiResponse.body == '{\"status\":\"ok\"}'; } }