Skip to content

Commit

Permalink
Release 1.0.27 - Pre-release process
Browse files Browse the repository at this point in the history
- Static analysis fixes
  • Loading branch information
phillwiggins committed Aug 28, 2020
1 parent 039cf29 commit b695f37
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 18 deletions.
2 changes: 1 addition & 1 deletion example/lib/pages/home_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class _HomePageState extends State<HomePage> {
title: const Text('Parse Server demo'),
actions: <Widget>[
FlatButton(
child: Text('Logout',
child: const Text('Logout',
style: TextStyle(fontSize: 17.0, color: Colors.white)),
onPressed: () async {
final ParseUser user = await ParseUser.currentUser();
Expand Down
2 changes: 1 addition & 1 deletion example_livelist/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ class _ObjectFormState extends State<ObjectForm> {
],
),
trailing: IconButton(
icon: Icon(Icons.save),
icon: const Icon(Icons.save),
onPressed: () {
setState(() {
_formKey.currentState.save();
Expand Down
8 changes: 6 additions & 2 deletions lib/src/data/parse_subclass_handler.dart
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,12 @@ class ParseSubClassHandler {
}

ParseObject createObject(String classname) {
if (classname == keyClassUser) return createParseUser(null, null, null);
if (_subClassMap.containsKey(classname)) return _subClassMap[classname]();
if (classname == keyClassUser) {
return createParseUser(null, null, null);
}
if (_subClassMap.containsKey(classname)) {
return _subClassMap[classname]();
}
return ParseObject(classname);
}

Expand Down
4 changes: 2 additions & 2 deletions lib/src/network/parse_query.dart
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ class QueryBuilder<T extends ParseObject> {
// 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.
// ignore: always_specify_types
void whereMatchesKeyInQuery(
String column, String keyInQuery, QueryBuilder query) {
String column, String keyInQuery, QueryBuilder<T> query) {
if (query.queries.isEmpty) {
throw ArgumentError('query conditions is required');
}
Expand All @@ -322,7 +322,7 @@ class QueryBuilder<T extends ParseObject> {
// 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
// ignore: always_specify_types
void whereDoesNotMatchKeyInQuery(
String column, String keyInQuery, QueryBuilder query) {
String column, String keyInQuery, QueryBuilder<T> query) {
if (query.queries.isEmpty) {
throw ArgumentError('query conditions is required');
}
Expand Down
2 changes: 1 addition & 1 deletion lib/src/objects/response/parse_response_builder.dart
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,6 @@ class _ParseResponseBuilder {
}

bool isHealthCheck(Response apiResponse) {
return ['{\"status\":\"ok\"}', 'OK'].contains(apiResponse.body);
return <String>['{\"status\":\"ok\"}', 'OK'].contains(apiResponse.body);
}
}
29 changes: 18 additions & 11 deletions lib/src/utils/parse_live_list.dart
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,9 @@ class ParseLiveList<T extends ParseObject> {

static Future<void> _loadIncludes(ParseObject object,
{ParseObject oldObject, Map<String, dynamic> paths}) async {
if (object == null || paths == null || paths.isEmpty) return;
if (object == null || paths == null || paths.isEmpty) {
return;
}

final List<Future<void>> loadingNodes = <Future<void>>[];

Expand Down Expand Up @@ -284,11 +286,13 @@ class ParseLiveList<T extends ParseObject> {
.then<void>((ParseResponse parseResponse) {
if (parseResponse.success &&
parseResponse.results.length == 1) {
// ignore: deprecated_member_use_from_same_package
object.getObjectData()[key] = parseResponse.results[0];
}
}));
continue;
} else {
// ignore: deprecated_member_use_from_same_package
object.getObjectData()[key] = includedObject;
//recursion
loadingNodes
Expand All @@ -305,6 +309,7 @@ class ParseLiveList<T extends ParseObject> {
loadingNodes.add(
queryBuilder.query().then<void>((ParseResponse parseResponse) {
if (parseResponse.success && parseResponse.results.length == 1) {
// ignore: deprecated_member_use_from_same_package
object.getObjectData()[key] = parseResponse.results[0];
}
}));
Expand All @@ -331,7 +336,7 @@ class ParseLiveList<T extends ParseObject> {
// ignore: avoid_as
if ((includes[key] as Map<String, dynamic>).isNotEmpty) {
includeList
.addAll(_toIncludeStringList(includes[key]).map((e) => '$key.$e'));
.addAll(_toIncludeStringList(includes[key]).map((String e) => '$key.$e'));
}
}
return includeList;
Expand All @@ -343,7 +348,9 @@ class ParseLiveList<T extends ParseObject> {
//(Hide first element, hide second, view first, view second => second is displayed twice)
object = object?.clone(object?.toJson(full: true));

if (!fetchedIncludes) await _loadIncludes(object, paths: _includePaths);
if (!fetchedIncludes) {
await _loadIncludes(object, paths: _includePaths);
}
for (int i = 0; i < _list.length; i++) {
if (after(object, _list[i].object) != true) {
_list.insert(
Expand Down Expand Up @@ -604,6 +611,7 @@ class ParseLiveListElement<T extends ParseObject> {
_subscriptionQueue.whenComplete(() async {
await ParseLiveList._loadIncludes(newObject,
oldObject: subObject, paths: _toKeyMap(path));
// ignore: deprecated_member_use_from_same_package
parentObject.getObjectData()[currentKey.key] = newObject;
if (!_streamController.isClosed) {
_streamController
Expand Down Expand Up @@ -667,21 +675,20 @@ class ParseLiveListElement<T extends ParseObject> {
if (subObject?.containsKey(keyVarUpdatedAt) == true) {
final QueryBuilder<ParseObject> queryBuilder =
QueryBuilder<ParseObject>(subObject)
..keysToReturn([keyVarUpdatedAt])
..keysToReturn(<String>[keyVarUpdatedAt])
..whereEqualTo(keyVarObjectId, subObject.objectId);
ParseResponse parseResponse = await queryBuilder.query();
if (parseResponse.success &&
(parseResponse.results.first as ParseObject).updatedAt !=
final ParseResponse parseResponse = await queryBuilder.query();
if (parseResponse.success && parseResponse.results.first.updatedAt !=
subObject.updatedAt) {
queryBuilder.limiters.remove("keys");
queryBuilder.limiters.remove('keys');
queryBuilder.includeObject(_getIncludeList(path[key]));
ParseResponse parseResponse = await queryBuilder.query();
final ParseResponse parseResponse = await queryBuilder.query();
if (parseResponse.success) {
subObject = parseResponse.result.first;
// root.getObjectData()[key.key] = subObject;
if (key.subscription?.eventCallbacks?.containsKey("update") ==
if (key.subscription?.eventCallbacks?.containsKey('update') ==
true) {
key.subscription.eventCallbacks["update"](subObject);
key.subscription.eventCallbacks['update'](subObject);
}
// key.subscription.eventCallbacks["update"](subObject);
break;
Expand Down

0 comments on commit b695f37

Please sign in to comment.