From 38611e683f1bb7fd0bd70e5a7e26743ae43ac501 Mon Sep 17 00:00:00 2001 From: tk2232 Date: Sun, 4 Jul 2021 20:37:12 +0200 Subject: [PATCH 01/48] fixes #653 ParseLiveListWidget is sending the wrong GET request if lazyloading is enabled and no order limiter is set. We have to check if there is a key to send --- packages/dart/lib/src/utils/parse_live_list.dart | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/dart/lib/src/utils/parse_live_list.dart b/packages/dart/lib/src/utils/parse_live_list.dart index fb6a74cd5..8b91d4639 100644 --- a/packages/dart/lib/src/utils/parse_live_list.dart +++ b/packages/dart/lib/src/utils/parse_live_list.dart @@ -31,6 +31,7 @@ class ParseLiveList { } final QueryBuilder _query; + //The included Items, where LiveList should look for updates. final Map _listeningIncludes; final bool _lazyLoading; @@ -142,7 +143,7 @@ class ParseLiveList { return string; }), ); - query.keysToReturn(keys); + if (keys.isNotEmpty) query.keysToReturn(keys); } return await query.query(); } @@ -738,6 +739,7 @@ class PathKey { final String key; Subscription? subscription; + @override String toString() { return 'PathKey(key: $key, subscription: ${subscription?.requestId})'; From 0c88af7a5bad1f75f6dcba6a8cfcaea3a1040728 Mon Sep 17 00:00:00 2001 From: Lasse Schuirmann Date: Mon, 2 Aug 2021 03:30:45 +0200 Subject: [PATCH 02/48] first: Correct return type Fixes https://github.com/parse-community/Parse-SDK-Flutter/issues/661 --- packages/dart/lib/src/network/parse_query.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/dart/lib/src/network/parse_query.dart b/packages/dart/lib/src/network/parse_query.dart index b2932ef06..057f901a6 100644 --- a/packages/dart/lib/src/network/parse_query.dart +++ b/packages/dart/lib/src/network/parse_query.dart @@ -536,7 +536,7 @@ class QueryBuilder { /// Find the first object that satisfies the query. /// Returns null, if no object is found. - Future? first() async { + Future first() async { ParseResponse parseResponse = await (QueryBuilder.copy(this)..setLimit(1)).query(); if (parseResponse.success) { From b0bddc69bf1b20c3558fb1beaa8f0856942a6044 Mon Sep 17 00:00:00 2001 From: Manas Malla Date: Tue, 28 Sep 2021 16:15:08 +0530 Subject: [PATCH 03/48] Update Readme.md Updated Readme.md to include information about some extra steps to support for the desktop - macOS platform to connect to the Web and retrive/store information on Parse server due to the changes in the macOS framwork after macOS 10.7 so that user's using the Parse SDK Flutter can get their app running quick and without issues. --- packages/flutter/README.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/packages/flutter/README.md b/packages/flutter/README.md index 8719e274b..9b99a6650 100644 --- a/packages/flutter/README.md +++ b/packages/flutter/README.md @@ -52,6 +52,19 @@ Due to Cross-origin resource sharing (CORS) restrictions, this requires adding ` When running directly via docker, set the env var `PARSE_SERVER_ALLOW_HEADERS=X-Parse-Installation-Id`. When running via express, set [ParseServerOptions](https://parseplatform.org/parse-server/api/master/ParseServerOptions.html) `allowHeaders: ['X-Parse-Installation-Id']`. +#### Desktop Support (macOS) +Due to security entitlements posed by the macOS framework, connecting to the Web and sharing data requires adding the following lines to code : +``` +com.apple.security.network.client + +``` +to the following files: +``` +/macOS/Runner/Release.entitlements +/macOS/Runner/DebugProfile.entitlements +``` +to help the Parse SDK for Flutter communicate with the Web to access the server and send/retrive data. + #### Network client By default, this SDK uses the `ParseHTTPClient`. Another option is use `ParseDioClient`. This client supports the most features (for example a progress callback at the file upload), but a benchmark has shown, that dio is slower than http on web. From 3f670d07ad7617a82e3469cf7450fbc009b05ec9 Mon Sep 17 00:00:00 2001 From: Rodrigo de Souza Marques Date: Wed, 20 Oct 2021 01:29:14 -0300 Subject: [PATCH 04/48] Fix logout error when no user is logged in / Update dependencies in pubspec.yaml Fix logout error when no user is logged in Update dependencies in pubspec.yaml --- packages/dart/lib/src/objects/parse_user.dart | 12 +++++++++++- packages/dart/pubspec.yaml | 18 +++++++++--------- .../.plugin_symlinks/connectivity_plus_linux | 2 +- .../flutter/generated_plugin_registrant.cc | 2 ++ .../flutter/generated_plugin_registrant.h | 2 ++ .../ephemeral/Flutter-Generated.xcconfig | 5 +++-- .../ephemeral/flutter_export_environment.sh | 5 +++-- packages/flutter/pubspec.yaml | 16 +++++++++------- 8 files changed, 40 insertions(+), 22 deletions(-) mode change 100644 => 100755 packages/flutter/example/macos/Flutter/ephemeral/flutter_export_environment.sh diff --git a/packages/dart/lib/src/objects/parse_user.dart b/packages/dart/lib/src/objects/parse_user.dart index dc90ae60d..5e75df787 100644 --- a/packages/dart/lib/src/objects/parse_user.dart +++ b/packages/dart/lib/src/objects/parse_user.dart @@ -315,7 +315,16 @@ class ParseUser extends ParseObject implements ParseCloneable { /// server. Will also delete the local user data unless /// deleteLocalUserData is false. Future logout({bool deleteLocalUserData = true}) async { - final String sessionId = ParseCoreData().sessionId!; + final String? sessionId = ParseCoreData().sessionId; + + if (sessionId == null) { + return await _handleResponse( + this, + ParseNetworkResponse(data: "{}", statusCode: 200), + ParseApiRQ.logout, + _debug, + parseClassName); + } forgetLocalSession(); @@ -449,6 +458,7 @@ class ParseUser extends ParseObject implements ParseCloneable { return handleException(e, ParseApiRQ.getAll, _debug, keyClassUser); } } + static Future _getUserFromLocalStore( {ParseCloneable? cloneable}) async { final CoreStore coreStore = ParseCoreData().getStore(); diff --git a/packages/dart/pubspec.yaml b/packages/dart/pubspec.yaml index 24fc1e74f..1ea293467 100644 --- a/packages/dart/pubspec.yaml +++ b/packages/dart/pubspec.yaml @@ -1,6 +1,6 @@ name: parse_server_sdk description: Dart plugin for Parse Server, (https://parseplatform.org), (https://back4app.com) -version: 3.1.0 +version: 3.2.0 homepage: https://github.com/phillwiggins/flutter_parse_sdk environment: @@ -9,22 +9,22 @@ environment: dependencies: # Networking dio: ^4.0.0 - http: ^0.13.3 + http: ^0.13.4 web_socket_channel: ^2.1.0 #Database - sembast: ^3.1.0+2 - sembast_web: ^2.0.0+2 + sembast: ^3.1.1 + sembast_web: ^2.0.1+1 xxtea: ^2.1.0 # Utils - uuid: ^3.0.4 - meta: ^1.3.0 + uuid: ^3.0.5 + meta: ^1.7.0 path: ^1.8.0 mime_type: ^1.0.0 dev_dependencies: # Testing - build_runner: ^2.0.5 - mockito: ^5.0.10 - test: ^1.17.9 + build_runner: ^2.1.4 + mockito: ^5.0.16 + test: ^1.18.2 diff --git a/packages/flutter/example/linux/flutter/ephemeral/.plugin_symlinks/connectivity_plus_linux b/packages/flutter/example/linux/flutter/ephemeral/.plugin_symlinks/connectivity_plus_linux index 6cc4956b2..79cdea687 120000 --- a/packages/flutter/example/linux/flutter/ephemeral/.plugin_symlinks/connectivity_plus_linux +++ b/packages/flutter/example/linux/flutter/ephemeral/.plugin_symlinks/connectivity_plus_linux @@ -1 +1 @@ -/Users/rodrigo/flutter/.pub-cache/hosted/pub.dartlang.org/connectivity_plus_linux-1.0.2/ \ No newline at end of file +/Users/rodrigo/flutter/.pub-cache/hosted/pub.dartlang.org/connectivity_plus_linux-1.1.0/ \ No newline at end of file diff --git a/packages/flutter/example/linux/flutter/generated_plugin_registrant.cc b/packages/flutter/example/linux/flutter/generated_plugin_registrant.cc index d38195aa0..e71a16d23 100644 --- a/packages/flutter/example/linux/flutter/generated_plugin_registrant.cc +++ b/packages/flutter/example/linux/flutter/generated_plugin_registrant.cc @@ -2,6 +2,8 @@ // Generated file. Do not edit. // +// clang-format off + #include "generated_plugin_registrant.h" diff --git a/packages/flutter/example/linux/flutter/generated_plugin_registrant.h b/packages/flutter/example/linux/flutter/generated_plugin_registrant.h index 9bf747894..e0f0a47bc 100644 --- a/packages/flutter/example/linux/flutter/generated_plugin_registrant.h +++ b/packages/flutter/example/linux/flutter/generated_plugin_registrant.h @@ -2,6 +2,8 @@ // Generated file. Do not edit. // +// clang-format off + #ifndef GENERATED_PLUGIN_REGISTRANT_ #define GENERATED_PLUGIN_REGISTRANT_ diff --git a/packages/flutter/example/macos/Flutter/ephemeral/Flutter-Generated.xcconfig b/packages/flutter/example/macos/Flutter/ephemeral/Flutter-Generated.xcconfig index 05050e176..71d954b5c 100644 --- a/packages/flutter/example/macos/Flutter/ephemeral/Flutter-Generated.xcconfig +++ b/packages/flutter/example/macos/Flutter/ephemeral/Flutter-Generated.xcconfig @@ -1,6 +1,7 @@ // This is a generated file; do not edit or check into version control. -FLUTTER_ROOT=C:\flutter -FLUTTER_APPLICATION_PATH=D:\GithubProjects\parse\Parse-SDK-Flutter\packages\flutter\example +FLUTTER_ROOT=/Users/rodrigo/flutter +FLUTTER_APPLICATION_PATH=/Volumes/SANDISK/Development/Github/Parse-SDK-Flutter/packages/flutter/example +COCOAPODS_PARALLEL_CODE_SIGN=true FLUTTER_BUILD_DIR=build FLUTTER_BUILD_NAME=1.0.0 FLUTTER_BUILD_NUMBER=1 diff --git a/packages/flutter/example/macos/Flutter/ephemeral/flutter_export_environment.sh b/packages/flutter/example/macos/Flutter/ephemeral/flutter_export_environment.sh old mode 100644 new mode 100755 index 6f35a01d7..a5dfb679a --- a/packages/flutter/example/macos/Flutter/ephemeral/flutter_export_environment.sh +++ b/packages/flutter/example/macos/Flutter/ephemeral/flutter_export_environment.sh @@ -1,7 +1,8 @@ #!/bin/sh # This is a generated file; do not edit or check into version control. -export "FLUTTER_ROOT=C:\flutter" -export "FLUTTER_APPLICATION_PATH=D:\GithubProjects\parse\Parse-SDK-Flutter\packages\flutter\example" +export "FLUTTER_ROOT=/Users/rodrigo/flutter" +export "FLUTTER_APPLICATION_PATH=/Volumes/SANDISK/Development/Github/Parse-SDK-Flutter/packages/flutter/example" +export "COCOAPODS_PARALLEL_CODE_SIGN=true" export "FLUTTER_BUILD_DIR=build" export "FLUTTER_BUILD_NAME=1.0.0" export "FLUTTER_BUILD_NUMBER=1" diff --git a/packages/flutter/pubspec.yaml b/packages/flutter/pubspec.yaml index 086a5bd62..d9551ff0b 100644 --- a/packages/flutter/pubspec.yaml +++ b/packages/flutter/pubspec.yaml @@ -1,6 +1,6 @@ name: parse_server_sdk_flutter description: Flutter plugin for Parse Server, (https://parseplatform.org), (https://back4app.com) -version: 3.1.0 +version: 3.2.0 homepage: https://github.com/phillwiggins/flutter_parse_sdk environment: @@ -21,24 +21,26 @@ dependencies: #parse_server_sdk: # git: # url: https://github.com/parse-community/Parse-SDK-Flutter.git - # ref: nullsafety + # ref: development # path: packages/dart # Networking dio: ^4.0.0 - connectivity_plus: ^1.0.1 # only used in the flutter part + connectivity_plus: ^2.0.2 # only used in the flutter part #Database - shared_preferences: ^2.0.5 # only used in the flutter part + shared_preferences: ^2.0.8 # only used in the flutter part + shared_preferences_web: ^2.0.2 # Utils - path_provider: ^2.0.1 # only used in the flutter part - package_info_plus: ^1.0.0 # only used in the flutter part + path_provider: ^2.0.5 # only used in the flutter part + package_info_plus: ^1.3.0 # only used in the flutter part sembast: ^3.0.0+4 # required for transitive use only + sembast_web: ^2.0.1+1 path: ^1.8.0 # required for transitive use only dev_dependencies: # Testing flutter_test: sdk: flutter - mockito: ^5.0.10 + mockito: ^5.0.16 From 11142322d44f60e230ab16c930df092c265b6388 Mon Sep 17 00:00:00 2001 From: Maximilian Fischer Date: Tue, 16 Nov 2021 13:28:37 +0100 Subject: [PATCH 05/48] docs: fix typo in README (#689) --- packages/dart/README.md | 2 +- packages/flutter/README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/dart/README.md b/packages/dart/README.md index c229992f5..924135a7b 100644 --- a/packages/dart/README.md +++ b/packages/dart/README.md @@ -249,7 +249,7 @@ This method returns an `Future` that either resolves in an error (equivalent of Choosing between `query()` and `find()` comes down to personal preference. Both methods can be used for querying a `ParseQuery`, just the output method differs. -Similar to `find()` the `QueryBuilder` also has a function called `Future? first()`. Just like `find()` `first()` is just a convenience method that makes querying the first object satisfying the query simpler. `first()` returns an `Future`, that resoles in an error or the first object matching the query. In case no object satisfies the query, the result will be `null`. +Similar to `find()` the `QueryBuilder` also has a function called `Future first()`. Just like `find()` `first()` is just a convenience method that makes querying the first object satisfying the query simpler. `first()` returns an `Future`, that resoles in an error or the first object matching the query. In case no object satisfies the query, the result will be `null`. ## Complex queries You can create complex queries to really put your database to the test: diff --git a/packages/flutter/README.md b/packages/flutter/README.md index 9b99a6650..a3761c1e2 100644 --- a/packages/flutter/README.md +++ b/packages/flutter/README.md @@ -279,7 +279,7 @@ This method returns an `Future` that either resolves in an error (equivalent of Choosing between `query()` and `find()` comes down to personal preference. Both methods can be used for querying a `ParseQuery`, just the output method differs. -Similar to `find()` the `QueryBuilder` also has a function called `Future? first()`. Just like `find()` `first()` is just a convenience method that makes querying the first object satisfying the query simpler. `first()` returns an `Future`, that resoles in an error or the first object matching the query. In case no object satisfies the query, the result will be `null`. +Similar to `find()` the `QueryBuilder` also has a function called `Future first()`. Just like `find()` `first()` is just a convenience method that makes querying the first object satisfying the query simpler. `first()` returns an `Future`, that resoles in an error or the first object matching the query. In case no object satisfies the query, the result will be `null`. ## Complex queries You can create complex queries to really put your database to the test: From 036448641ab8fda8368c8e7ded37de90f8b56cca Mon Sep 17 00:00:00 2001 From: Rodrigo de Souza Marques Date: Thu, 3 Feb 2022 08:49:26 -0300 Subject: [PATCH 06/48] Fix ParseFile transfer --- packages/dart/lib/src/objects/parse_file.dart | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/dart/lib/src/objects/parse_file.dart b/packages/dart/lib/src/objects/parse_file.dart index 35ed5c8fd..f35af0bca 100644 --- a/packages/dart/lib/src/objects/parse_file.dart +++ b/packages/dart/lib/src/objects/parse_file.dart @@ -71,6 +71,7 @@ class ParseFile extends ParseFileBase { final Map headers = { HttpHeaders.contentTypeHeader: mime(file!.path) ?? 'application/octet-stream', + HttpHeaders.contentLengthHeader: '${file!.lengthSync() ?? 0}', }; try { final String uri = ParseCoreData().serverUrl + '$_path'; From 78dd3d6125b8c4a77ea6ce1c83960c5d1f2e30db Mon Sep 17 00:00:00 2001 From: Rodrigo de Souza Marques Date: Fri, 22 Apr 2022 23:17:41 -0300 Subject: [PATCH 07/48] Update dependencies versions --- packages/dart/pubspec.yaml | 14 +++++++------- .../.plugin_symlinks/connectivity_plus_linux | 2 +- .../.plugin_symlinks/package_info_plus_linux | 1 + .../.plugin_symlinks/path_provider_linux | 2 +- .../.plugin_symlinks/shared_preferences_linux | 2 +- packages/flutter/pubspec.yaml | 16 ++++++++-------- 6 files changed, 19 insertions(+), 18 deletions(-) create mode 120000 packages/flutter/example/linux/flutter/ephemeral/.plugin_symlinks/package_info_plus_linux diff --git a/packages/dart/pubspec.yaml b/packages/dart/pubspec.yaml index 1ea293467..0f5337296 100644 --- a/packages/dart/pubspec.yaml +++ b/packages/dart/pubspec.yaml @@ -8,23 +8,23 @@ environment: dependencies: # Networking - dio: ^4.0.0 + dio: ^4.0.6 http: ^0.13.4 web_socket_channel: ^2.1.0 #Database - sembast: ^3.1.1 + sembast: ^3.2.0 sembast_web: ^2.0.1+1 xxtea: ^2.1.0 # Utils - uuid: ^3.0.5 + uuid: ^3.0.6 meta: ^1.7.0 - path: ^1.8.0 + path: ^1.8.1 mime_type: ^1.0.0 dev_dependencies: # Testing - build_runner: ^2.1.4 - mockito: ^5.0.16 - test: ^1.18.2 + build_runner: ^2.1.10 + mockito: ^5.1.0 + test: ^1.21.0 diff --git a/packages/flutter/example/linux/flutter/ephemeral/.plugin_symlinks/connectivity_plus_linux b/packages/flutter/example/linux/flutter/ephemeral/.plugin_symlinks/connectivity_plus_linux index 79cdea687..bed50da18 120000 --- a/packages/flutter/example/linux/flutter/ephemeral/.plugin_symlinks/connectivity_plus_linux +++ b/packages/flutter/example/linux/flutter/ephemeral/.plugin_symlinks/connectivity_plus_linux @@ -1 +1 @@ -/Users/rodrigo/flutter/.pub-cache/hosted/pub.dartlang.org/connectivity_plus_linux-1.1.0/ \ No newline at end of file +/Users/rodrigo/flutter/.pub-cache/hosted/pub.dartlang.org/connectivity_plus_linux-1.3.0/ \ No newline at end of file diff --git a/packages/flutter/example/linux/flutter/ephemeral/.plugin_symlinks/package_info_plus_linux b/packages/flutter/example/linux/flutter/ephemeral/.plugin_symlinks/package_info_plus_linux new file mode 120000 index 000000000..94f271118 --- /dev/null +++ b/packages/flutter/example/linux/flutter/ephemeral/.plugin_symlinks/package_info_plus_linux @@ -0,0 +1 @@ +/Users/rodrigo/flutter/.pub-cache/hosted/pub.dartlang.org/package_info_plus_linux-1.0.5/ \ No newline at end of file diff --git a/packages/flutter/example/linux/flutter/ephemeral/.plugin_symlinks/path_provider_linux b/packages/flutter/example/linux/flutter/ephemeral/.plugin_symlinks/path_provider_linux index a2f4bd65d..15207934e 120000 --- a/packages/flutter/example/linux/flutter/ephemeral/.plugin_symlinks/path_provider_linux +++ b/packages/flutter/example/linux/flutter/ephemeral/.plugin_symlinks/path_provider_linux @@ -1 +1 @@ -/Users/rodrigo/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_linux-2.0.0/ \ No newline at end of file +/Users/rodrigo/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_linux-2.1.5/ \ No newline at end of file diff --git a/packages/flutter/example/linux/flutter/ephemeral/.plugin_symlinks/shared_preferences_linux b/packages/flutter/example/linux/flutter/ephemeral/.plugin_symlinks/shared_preferences_linux index 75b80e9f2..d7be94dbb 120000 --- a/packages/flutter/example/linux/flutter/ephemeral/.plugin_symlinks/shared_preferences_linux +++ b/packages/flutter/example/linux/flutter/ephemeral/.plugin_symlinks/shared_preferences_linux @@ -1 +1 @@ -/Users/rodrigo/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_linux-2.0.0/ \ No newline at end of file +/Users/rodrigo/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_linux-2.1.0/ \ No newline at end of file diff --git a/packages/flutter/pubspec.yaml b/packages/flutter/pubspec.yaml index d9551ff0b..50d17c4d2 100644 --- a/packages/flutter/pubspec.yaml +++ b/packages/flutter/pubspec.yaml @@ -25,17 +25,17 @@ dependencies: # path: packages/dart # Networking - dio: ^4.0.0 - connectivity_plus: ^2.0.2 # only used in the flutter part + dio: ^4.0.6 + connectivity_plus: ^2.3.0 # only used in the flutter part #Database - shared_preferences: ^2.0.8 # only used in the flutter part - shared_preferences_web: ^2.0.2 + shared_preferences: ^2.0.13 # only used in the flutter part + shared_preferences_web: ^2.0.3 # Utils - path_provider: ^2.0.5 # only used in the flutter part - package_info_plus: ^1.3.0 # only used in the flutter part - sembast: ^3.0.0+4 # required for transitive use only + path_provider: ^2.0.9 # only used in the flutter part + package_info_plus: ^1.4.2 # only used in the flutter part + sembast: ^3.2.0 sembast_web: ^2.0.1+1 path: ^1.8.0 # required for transitive use only @@ -43,4 +43,4 @@ dev_dependencies: # Testing flutter_test: sdk: flutter - mockito: ^5.0.16 + mockito: ^5.1.0 From aa4b3b53022b14cdc8eedd6c6767f31a96d69595 Mon Sep 17 00:00:00 2001 From: Rodrigo de Souza Marques Date: Sat, 23 Apr 2022 00:40:55 -0300 Subject: [PATCH 08/48] Fix #697 / Update Constants --- packages/dart/lib/src/base/parse_constants.dart | 2 +- packages/dart/lib/src/objects/parse_relation.dart | 2 +- packages/dart/pubspec.yaml | 5 ++++- packages/flutter/pubspec.yaml | 9 ++++++--- 4 files changed, 12 insertions(+), 6 deletions(-) diff --git a/packages/dart/lib/src/base/parse_constants.dart b/packages/dart/lib/src/base/parse_constants.dart index a1c96cf18..86bc88267 100644 --- a/packages/dart/lib/src/base/parse_constants.dart +++ b/packages/dart/lib/src/base/parse_constants.dart @@ -1,7 +1,7 @@ part of flutter_parse_sdk; // Library -const String keySdkVersion = '3.1.0'; +const String keySdkVersion = '3.2.0'; const String keyLibraryName = 'Flutter Parse SDK'; // End Points diff --git a/packages/dart/lib/src/objects/parse_relation.dart b/packages/dart/lib/src/objects/parse_relation.dart index 2f3721f8f..7509b2c5a 100644 --- a/packages/dart/lib/src/objects/parse_relation.dart +++ b/packages/dart/lib/src/objects/parse_relation.dart @@ -29,7 +29,7 @@ class ParseRelation { Set? _knownObjects = Set(); QueryBuilder getQuery() { - return QueryBuilder(ParseObject(_targetClass!)) + return QueryBuilder(ParseCoreData.instance.createObject(_targetClass!)) ..whereRelatedTo(_key, _parent!.parseClassName, _parentObjectId); } diff --git a/packages/dart/pubspec.yaml b/packages/dart/pubspec.yaml index 0f5337296..901da78cf 100644 --- a/packages/dart/pubspec.yaml +++ b/packages/dart/pubspec.yaml @@ -20,9 +20,12 @@ dependencies: # Utils uuid: ^3.0.6 meta: ^1.7.0 - path: ^1.8.1 + path: ^1.8.0 mime_type: ^1.0.0 +dependency_overrides: + path: ^1.8.1 # required for transitive use only + dev_dependencies: # Testing build_runner: ^2.1.10 diff --git a/packages/flutter/pubspec.yaml b/packages/flutter/pubspec.yaml index 50d17c4d2..9c0b72db3 100644 --- a/packages/flutter/pubspec.yaml +++ b/packages/flutter/pubspec.yaml @@ -11,11 +11,11 @@ dependencies: sdk: flutter #Uncomment for Release version - parse_server_sdk: ^3.1.0 + #parse_server_sdk: ^3.1.0 # Uncomment for local testing - #parse_server_sdk: - # path: ../dart + parse_server_sdk: + path: ../dart # Uncomment for test with Github Branch #parse_server_sdk: @@ -39,6 +39,9 @@ dependencies: sembast_web: ^2.0.1+1 path: ^1.8.0 # required for transitive use only +dependency_overrides: + path: ^1.8.1 # required for transitive use only + dev_dependencies: # Testing flutter_test: From c7ca772f198eed2790b7712d199b14efac07142c Mon Sep 17 00:00:00 2001 From: Rodrigo de Souza Marques Date: Mon, 25 Apr 2022 00:35:34 -0300 Subject: [PATCH 09/48] Update pubspec.yaml with override dependency --- packages/flutter/pubspec.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/flutter/pubspec.yaml b/packages/flutter/pubspec.yaml index 9c0b72db3..593a4559e 100644 --- a/packages/flutter/pubspec.yaml +++ b/packages/flutter/pubspec.yaml @@ -41,6 +41,7 @@ dependencies: dependency_overrides: path: ^1.8.1 # required for transitive use only + platform: ^3.1.0 dev_dependencies: # Testing From 5d561f72ad2c58ae62ca8e2008e4820c9161d521 Mon Sep 17 00:00:00 2001 From: Rodrigo de Souza Marques Date: Mon, 25 Apr 2022 00:43:37 -0300 Subject: [PATCH 10/48] Update pubspec.yaml --- packages/flutter/pubspec.yaml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/flutter/pubspec.yaml b/packages/flutter/pubspec.yaml index 593a4559e..f27a0a5dc 100644 --- a/packages/flutter/pubspec.yaml +++ b/packages/flutter/pubspec.yaml @@ -14,15 +14,15 @@ dependencies: #parse_server_sdk: ^3.1.0 # Uncomment for local testing - parse_server_sdk: - path: ../dart + #parse_server_sdk: + # path: ../dart # Uncomment for test with Github Branch - #parse_server_sdk: - # git: - # url: https://github.com/parse-community/Parse-SDK-Flutter.git - # ref: development - # path: packages/dart + parse_server_sdk: + git: + url: https://github.com/parse-community/Parse-SDK-Flutter.git + ref: development + path: packages/dart # Networking dio: ^4.0.6 From ef26c34b19f1db43ed0081b807ddc9c9829a67ee Mon Sep 17 00:00:00 2001 From: Rodrigo de Souza Marques Date: Mon, 25 Apr 2022 00:45:08 -0300 Subject: [PATCH 11/48] Update package version --- packages/dart/lib/src/base/parse_constants.dart | 2 +- packages/dart/pubspec.yaml | 2 +- packages/flutter/pubspec.yaml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/dart/lib/src/base/parse_constants.dart b/packages/dart/lib/src/base/parse_constants.dart index 86bc88267..8a72eb63e 100644 --- a/packages/dart/lib/src/base/parse_constants.dart +++ b/packages/dart/lib/src/base/parse_constants.dart @@ -1,7 +1,7 @@ part of flutter_parse_sdk; // Library -const String keySdkVersion = '3.2.0'; +const String keySdkVersion = '4.0.0'; const String keyLibraryName = 'Flutter Parse SDK'; // End Points diff --git a/packages/dart/pubspec.yaml b/packages/dart/pubspec.yaml index 901da78cf..d7db9fdea 100644 --- a/packages/dart/pubspec.yaml +++ b/packages/dart/pubspec.yaml @@ -1,6 +1,6 @@ name: parse_server_sdk description: Dart plugin for Parse Server, (https://parseplatform.org), (https://back4app.com) -version: 3.2.0 +version: 4.0.0 homepage: https://github.com/phillwiggins/flutter_parse_sdk environment: diff --git a/packages/flutter/pubspec.yaml b/packages/flutter/pubspec.yaml index f27a0a5dc..e6831a5c1 100644 --- a/packages/flutter/pubspec.yaml +++ b/packages/flutter/pubspec.yaml @@ -1,6 +1,6 @@ name: parse_server_sdk_flutter description: Flutter plugin for Parse Server, (https://parseplatform.org), (https://back4app.com) -version: 3.2.0 +version: 4.0.0 homepage: https://github.com/phillwiggins/flutter_parse_sdk environment: From ecea19dcebc25edc2b7a163d45a3bd01b3d232fb Mon Sep 17 00:00:00 2001 From: Rodrigo de Souza Marques Date: Mon, 25 Apr 2022 00:48:27 -0300 Subject: [PATCH 12/48] Update pubspec.yaml --- packages/flutter/pubspec.yaml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/flutter/pubspec.yaml b/packages/flutter/pubspec.yaml index e6831a5c1..80bd164f9 100644 --- a/packages/flutter/pubspec.yaml +++ b/packages/flutter/pubspec.yaml @@ -18,9 +18,15 @@ dependencies: # path: ../dart # Uncomment for test with Github Branch +# parse_server_sdk: +# git: +# url: https://github.com/parse-community/Parse-SDK-Flutter.git +# ref: development +# path: packages/dart + parse_server_sdk: git: - url: https://github.com/parse-community/Parse-SDK-Flutter.git + url: https://github.com/RodrigoSMarques/Parse-SDK-Flutter.git ref: development path: packages/dart From 2549265130ea908a8358da1d7e660c2157e2865d Mon Sep 17 00:00:00 2001 From: Rodrigo de Souza Marques Date: Mon, 25 Apr 2022 23:40:44 -0300 Subject: [PATCH 13/48] Update parse_file.dart --- packages/dart/lib/src/objects/parse_file.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/dart/lib/src/objects/parse_file.dart b/packages/dart/lib/src/objects/parse_file.dart index f35af0bca..214c7135f 100644 --- a/packages/dart/lib/src/objects/parse_file.dart +++ b/packages/dart/lib/src/objects/parse_file.dart @@ -71,7 +71,7 @@ class ParseFile extends ParseFileBase { final Map headers = { HttpHeaders.contentTypeHeader: mime(file!.path) ?? 'application/octet-stream', - HttpHeaders.contentLengthHeader: '${file!.lengthSync() ?? 0}', + HttpHeaders.contentLengthHeader: '${file!.lengthSync()}', }; try { final String uri = ParseCoreData().serverUrl + '$_path'; From 428370847efed777414506c4403d97fa6dd7fd47 Mon Sep 17 00:00:00 2001 From: Rodrigo de Souza Marques Date: Mon, 2 May 2022 02:25:49 -0300 Subject: [PATCH 14/48] New version 3.2.0 Fixes for version 3.2.0 --- packages/dart/CHANGELOG.md | 12 ++++++++++++ packages/dart/lib/src/base/parse_constants.dart | 2 +- packages/dart/pubspec.yaml | 4 ++-- packages/flutter/CHANGELOG.md | 12 ++++++++++++ packages/flutter/pubspec.yaml | 14 ++++---------- 5 files changed, 31 insertions(+), 13 deletions(-) diff --git a/packages/dart/CHANGELOG.md b/packages/dart/CHANGELOG.md index be6aaf707..de5d1631b 100644 --- a/packages/dart/CHANGELOG.md +++ b/packages/dart/CHANGELOG.md @@ -1,3 +1,15 @@ +## 3.2.0 +Bug fixes: + * #717 - Old version of connectivity_plus package + * #714 - package_info_plus not work in web + * #712 - MissingPluginException (No implementation found for method getAll) + * #696 - ParseRelation#query - Unhandled Exception: type 'ParseObject' is not a subtype of type + * #679 - Error in progressCallback + * #661 - first: Correct return type + * #653 - ParseLiveListWidget MongoError +Updated dependencies versions +Documentation update + ## 3.1.0 Bug fixes General improvements diff --git a/packages/dart/lib/src/base/parse_constants.dart b/packages/dart/lib/src/base/parse_constants.dart index 8a72eb63e..86bc88267 100644 --- a/packages/dart/lib/src/base/parse_constants.dart +++ b/packages/dart/lib/src/base/parse_constants.dart @@ -1,7 +1,7 @@ part of flutter_parse_sdk; // Library -const String keySdkVersion = '4.0.0'; +const String keySdkVersion = '3.2.0'; const String keyLibraryName = 'Flutter Parse SDK'; // End Points diff --git a/packages/dart/pubspec.yaml b/packages/dart/pubspec.yaml index d7db9fdea..26dc03005 100644 --- a/packages/dart/pubspec.yaml +++ b/packages/dart/pubspec.yaml @@ -1,7 +1,7 @@ name: parse_server_sdk description: Dart plugin for Parse Server, (https://parseplatform.org), (https://back4app.com) -version: 4.0.0 -homepage: https://github.com/phillwiggins/flutter_parse_sdk +version: 3.2.0 +homepage: https://github.com/parse-community/Parse-SDK-Flutter environment: sdk: '>=2.12.0 <3.0.0' diff --git a/packages/flutter/CHANGELOG.md b/packages/flutter/CHANGELOG.md index 4db9f515e..88e45d8f2 100644 --- a/packages/flutter/CHANGELOG.md +++ b/packages/flutter/CHANGELOG.md @@ -1,3 +1,15 @@ +## 3.2.0 +Bug fixes: + * #717 - Old version of connectivity_plus package + * #714 - package_info_plus not work in web + * #712 - MissingPluginException (No implementation found for method getAll) + * #696 - ParseRelation#query - Unhandled Exception: type 'ParseObject' is not a subtype of type + * #679 - Error in progressCallback + * #661 - first: Correct return type + * #653 - ParseLiveListWidget MongoError +Updated dependencies versions +Documentation update + ## 3.1.0 Bug fixes General improvements diff --git a/packages/flutter/pubspec.yaml b/packages/flutter/pubspec.yaml index 80bd164f9..78ef992f7 100644 --- a/packages/flutter/pubspec.yaml +++ b/packages/flutter/pubspec.yaml @@ -1,7 +1,7 @@ name: parse_server_sdk_flutter description: Flutter plugin for Parse Server, (https://parseplatform.org), (https://back4app.com) -version: 4.0.0 -homepage: https://github.com/phillwiggins/flutter_parse_sdk +version: 3.2.0 +homepage: https://github.com/parse-community/Parse-SDK-Flutter environment: sdk: '>=2.12.0 <3.0.0' @@ -11,7 +11,7 @@ dependencies: sdk: flutter #Uncomment for Release version - #parse_server_sdk: ^3.1.0 + parse_server_sdk: ^3.2.0 # Uncomment for local testing #parse_server_sdk: @@ -24,19 +24,13 @@ dependencies: # ref: development # path: packages/dart - parse_server_sdk: - git: - url: https://github.com/RodrigoSMarques/Parse-SDK-Flutter.git - ref: development - path: packages/dart - # Networking dio: ^4.0.6 connectivity_plus: ^2.3.0 # only used in the flutter part #Database shared_preferences: ^2.0.13 # only used in the flutter part - shared_preferences_web: ^2.0.3 + #shared_preferences_web: ^2.0.3 # Utils path_provider: ^2.0.9 # only used in the flutter part From e88871678e9fe35102faaa1e8534fb76413e3fbe Mon Sep 17 00:00:00 2001 From: Rodrigo de Souza Marques Date: Tue, 10 May 2022 00:43:44 -0300 Subject: [PATCH 15/48] Update .gitignore --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index 56909ccd3..aefb6cab4 100644 --- a/.gitignore +++ b/.gitignore @@ -116,3 +116,5 @@ app.*.symbols !**/ios/**/default.perspectivev3 !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages !/dev/ci/**/Gemfile.lock +/packages/flutter/example/linux/flutter/ephemeral/ +/packages/flutter/example/macos/Flutter/ephemeral/ From 7dd3a2dccb512fe97d618d6bbf9ad9e4a1df3db1 Mon Sep 17 00:00:00 2001 From: Rodrigo de Souza Marques Date: Tue, 10 May 2022 00:46:27 -0300 Subject: [PATCH 16/48] Remove unnecessary files from the project Remove unnecessary files from the project --- .../.plugin_symlinks/connectivity_plus_linux | 1 - .../.plugin_symlinks/package_info_plus_linux | 1 - .../ephemeral/.plugin_symlinks/path_provider_linux | 1 - .../.plugin_symlinks/shared_preferences_linux | 1 - .../Flutter/ephemeral/Flutter-Generated.xcconfig | 12 ------------ .../Flutter/ephemeral/flutter_export_environment.sh | 13 ------------- 6 files changed, 29 deletions(-) delete mode 120000 packages/flutter/example/linux/flutter/ephemeral/.plugin_symlinks/connectivity_plus_linux delete mode 120000 packages/flutter/example/linux/flutter/ephemeral/.plugin_symlinks/package_info_plus_linux delete mode 120000 packages/flutter/example/linux/flutter/ephemeral/.plugin_symlinks/path_provider_linux delete mode 120000 packages/flutter/example/linux/flutter/ephemeral/.plugin_symlinks/shared_preferences_linux delete mode 100644 packages/flutter/example/macos/Flutter/ephemeral/Flutter-Generated.xcconfig delete mode 100755 packages/flutter/example/macos/Flutter/ephemeral/flutter_export_environment.sh diff --git a/packages/flutter/example/linux/flutter/ephemeral/.plugin_symlinks/connectivity_plus_linux b/packages/flutter/example/linux/flutter/ephemeral/.plugin_symlinks/connectivity_plus_linux deleted file mode 120000 index bed50da18..000000000 --- a/packages/flutter/example/linux/flutter/ephemeral/.plugin_symlinks/connectivity_plus_linux +++ /dev/null @@ -1 +0,0 @@ -/Users/rodrigo/flutter/.pub-cache/hosted/pub.dartlang.org/connectivity_plus_linux-1.3.0/ \ No newline at end of file diff --git a/packages/flutter/example/linux/flutter/ephemeral/.plugin_symlinks/package_info_plus_linux b/packages/flutter/example/linux/flutter/ephemeral/.plugin_symlinks/package_info_plus_linux deleted file mode 120000 index 94f271118..000000000 --- a/packages/flutter/example/linux/flutter/ephemeral/.plugin_symlinks/package_info_plus_linux +++ /dev/null @@ -1 +0,0 @@ -/Users/rodrigo/flutter/.pub-cache/hosted/pub.dartlang.org/package_info_plus_linux-1.0.5/ \ No newline at end of file diff --git a/packages/flutter/example/linux/flutter/ephemeral/.plugin_symlinks/path_provider_linux b/packages/flutter/example/linux/flutter/ephemeral/.plugin_symlinks/path_provider_linux deleted file mode 120000 index 15207934e..000000000 --- a/packages/flutter/example/linux/flutter/ephemeral/.plugin_symlinks/path_provider_linux +++ /dev/null @@ -1 +0,0 @@ -/Users/rodrigo/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_linux-2.1.5/ \ No newline at end of file diff --git a/packages/flutter/example/linux/flutter/ephemeral/.plugin_symlinks/shared_preferences_linux b/packages/flutter/example/linux/flutter/ephemeral/.plugin_symlinks/shared_preferences_linux deleted file mode 120000 index d7be94dbb..000000000 --- a/packages/flutter/example/linux/flutter/ephemeral/.plugin_symlinks/shared_preferences_linux +++ /dev/null @@ -1 +0,0 @@ -/Users/rodrigo/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_linux-2.1.0/ \ No newline at end of file diff --git a/packages/flutter/example/macos/Flutter/ephemeral/Flutter-Generated.xcconfig b/packages/flutter/example/macos/Flutter/ephemeral/Flutter-Generated.xcconfig deleted file mode 100644 index 71d954b5c..000000000 --- a/packages/flutter/example/macos/Flutter/ephemeral/Flutter-Generated.xcconfig +++ /dev/null @@ -1,12 +0,0 @@ -// This is a generated file; do not edit or check into version control. -FLUTTER_ROOT=/Users/rodrigo/flutter -FLUTTER_APPLICATION_PATH=/Volumes/SANDISK/Development/Github/Parse-SDK-Flutter/packages/flutter/example -COCOAPODS_PARALLEL_CODE_SIGN=true -FLUTTER_BUILD_DIR=build -FLUTTER_BUILD_NAME=1.0.0 -FLUTTER_BUILD_NUMBER=1 -EXCLUDED_ARCHS=arm64 -DART_OBFUSCATION=false -TRACK_WIDGET_CREATION=false -TREE_SHAKE_ICONS=false -PACKAGE_CONFIG=.packages diff --git a/packages/flutter/example/macos/Flutter/ephemeral/flutter_export_environment.sh b/packages/flutter/example/macos/Flutter/ephemeral/flutter_export_environment.sh deleted file mode 100755 index a5dfb679a..000000000 --- a/packages/flutter/example/macos/Flutter/ephemeral/flutter_export_environment.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/sh -# This is a generated file; do not edit or check into version control. -export "FLUTTER_ROOT=/Users/rodrigo/flutter" -export "FLUTTER_APPLICATION_PATH=/Volumes/SANDISK/Development/Github/Parse-SDK-Flutter/packages/flutter/example" -export "COCOAPODS_PARALLEL_CODE_SIGN=true" -export "FLUTTER_BUILD_DIR=build" -export "FLUTTER_BUILD_NAME=1.0.0" -export "FLUTTER_BUILD_NUMBER=1" -export "EXCLUDED_ARCHS=arm64" -export "DART_OBFUSCATION=false" -export "TRACK_WIDGET_CREATION=false" -export "TREE_SHAKE_ICONS=false" -export "PACKAGE_CONFIG=.packages" From 560a65cc264f8451760ec0fa651704fcfc4d5149 Mon Sep 17 00:00:00 2001 From: tk2232 Date: Sun, 4 Jul 2021 20:37:12 +0200 Subject: [PATCH 17/48] fixes #653 ParseLiveListWidget is sending the wrong GET request if lazyloading is enabled and no order limiter is set. We have to check if there is a key to send --- packages/dart/lib/src/utils/parse_live_list.dart | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/dart/lib/src/utils/parse_live_list.dart b/packages/dart/lib/src/utils/parse_live_list.dart index fb6a74cd5..8b91d4639 100644 --- a/packages/dart/lib/src/utils/parse_live_list.dart +++ b/packages/dart/lib/src/utils/parse_live_list.dart @@ -31,6 +31,7 @@ class ParseLiveList { } final QueryBuilder _query; + //The included Items, where LiveList should look for updates. final Map _listeningIncludes; final bool _lazyLoading; @@ -142,7 +143,7 @@ class ParseLiveList { return string; }), ); - query.keysToReturn(keys); + if (keys.isNotEmpty) query.keysToReturn(keys); } return await query.query(); } @@ -738,6 +739,7 @@ class PathKey { final String key; Subscription? subscription; + @override String toString() { return 'PathKey(key: $key, subscription: ${subscription?.requestId})'; From 3357093f99f1dbb0e4aa1ce518085fdf4969a8bb Mon Sep 17 00:00:00 2001 From: Lasse Schuirmann Date: Mon, 2 Aug 2021 03:30:45 +0200 Subject: [PATCH 18/48] first: Correct return type Fixes https://github.com/parse-community/Parse-SDK-Flutter/issues/661 --- packages/dart/lib/src/network/parse_query.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/dart/lib/src/network/parse_query.dart b/packages/dart/lib/src/network/parse_query.dart index b2932ef06..057f901a6 100644 --- a/packages/dart/lib/src/network/parse_query.dart +++ b/packages/dart/lib/src/network/parse_query.dart @@ -536,7 +536,7 @@ class QueryBuilder { /// Find the first object that satisfies the query. /// Returns null, if no object is found. - Future? first() async { + Future first() async { ParseResponse parseResponse = await (QueryBuilder.copy(this)..setLimit(1)).query(); if (parseResponse.success) { From 3a4a7e456d64a118ebcc4752f8944e2943ebf5ea Mon Sep 17 00:00:00 2001 From: Tom Fox <13188249+TomWFox@users.noreply.github.com> Date: Tue, 3 Aug 2021 00:21:03 +0100 Subject: [PATCH 19/48] Create config.yml --- .github/ISSUE_TEMPLATE/config.yml | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/config.yml diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 000000000..e5a8c3caa --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,8 @@ +blank_issues_enabled: false +contact_links: + - name: 🙋🏽‍♀️ Getting help with code + url: https://stackoverflow.com/questions/tagged/parse-platform + about: Get help with code-level questions on Stack Overflow. + - name: 🙋 Getting general help + url: https://community.parseplatform.org + about: Get help with other questions on our Community Forum. From c1361dd06a25bbfbe584d1030259d84e7a9bcb22 Mon Sep 17 00:00:00 2001 From: Tom Fox <13188249+TomWFox@users.noreply.github.com> Date: Tue, 3 Aug 2021 00:21:58 +0100 Subject: [PATCH 20/48] Add files via upload --- .../ISSUE_TEMPLATE/---1-report-an-issue.md | 64 +++++++++++++++++++ .../ISSUE_TEMPLATE/---2-feature-request.md | 34 ++++++++++ 2 files changed, 98 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/---1-report-an-issue.md create mode 100644 .github/ISSUE_TEMPLATE/---2-feature-request.md diff --git a/.github/ISSUE_TEMPLATE/---1-report-an-issue.md b/.github/ISSUE_TEMPLATE/---1-report-an-issue.md new file mode 100644 index 000000000..a0369b51f --- /dev/null +++ b/.github/ISSUE_TEMPLATE/---1-report-an-issue.md @@ -0,0 +1,64 @@ +--- +name: "\U0001F41B Report an issue" +about: A feature is not working as expected. +title: '' +labels: '' +assignees: '' + +--- + +### New Issue Checklist + + +- [ ] I am not disclosing a [vulnerability](https://github.com/parse-community/Parse-Swift/security/policy). +- [ ] I am not just asking a [question](https://github.com/parse-community/.github/blob/main/SUPPORT.md). +- [ ] I have searched through [existing issues](https://github.com/parse-community/Parse-Swift/issues?q=is%3Aissue). +- [ ] I can reproduce the issue with the [latest version of Parse Swift](https://github.com/parse-community/Parse-Swift/releases). +- [ ] I can reproduce the issue with the [latest version of Parse Server](https://github.com/parse-community/parse-server/releases). + +### Issue Description + + +### Steps to reproduce + + +### Actual Outcome + + +### Expected Outcome + + +### Failing Test Case / Pull Request + + +- [ ] 🤩 I submitted a PR with a fix and a test case. +- [ ] 🧐 I submitted a PR with a failing test case. + +### Environment + + +Parse Swift +- SDK version: `FILL_THIS_OUT` +- Operating system (iOS, macOS, watchOS, etc.): `FILL_THIS_OUT` +- Operating system version: `FILL_THIS_OUT` + +Server +- Parse Server version: `FILL_THIS_OUT` +- Operating system: `FILL_THIS_OUT` +- Local or remote host (AWS, Azure, Google Cloud, Heroku, Digital Ocean, etc): `FILL_THIS_OUT` + +Database +- System (MongoDB or Postgres): `FILL_THIS_OUT` +- Database version: `FILL_THIS_OUT` +- Local or remote host (MongoDB Atlas, mLab, AWS, Azure, Google Cloud, etc): `FILL_THIS_OUT` + +### Logs + diff --git a/.github/ISSUE_TEMPLATE/---2-feature-request.md b/.github/ISSUE_TEMPLATE/---2-feature-request.md new file mode 100644 index 000000000..fa5e4e7dd --- /dev/null +++ b/.github/ISSUE_TEMPLATE/---2-feature-request.md @@ -0,0 +1,34 @@ +--- +name: "\U0001F4A1 Request a feature" +about: Suggest new functionality or an enhancement of existing functionality. +title: '' +labels: '' +assignees: '' + +--- + +### New Feature / Enhancement Checklist + + +- [ ] I am not disclosing a [vulnerability](https://github.com/parse-community/Parse-Swift/security/policy). +- [ ] I am not just asking a [question](https://github.com/parse-community/.github/blob/main/SUPPORT.md). +- [ ] I have searched through [existing issues](https://github.com/parse-community/Parse-Swift/issues?q=is%3Aissue). + +### Current Limitation + + +### Feature / Enhancement Description + + +### Example Use Case + + +### Alternatives / Workarounds + + +### 3rd Party References + From 2e269281a81ed33a8651d92aa0622aef69cc75f9 Mon Sep 17 00:00:00 2001 From: Tom Fox <13188249+TomWFox@users.noreply.github.com> Date: Thu, 5 Aug 2021 00:42:48 +0100 Subject: [PATCH 21/48] Update ---1-report-an-issue.md --- .github/ISSUE_TEMPLATE/---1-report-an-issue.md | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/---1-report-an-issue.md b/.github/ISSUE_TEMPLATE/---1-report-an-issue.md index a0369b51f..ece53cb38 100644 --- a/.github/ISSUE_TEMPLATE/---1-report-an-issue.md +++ b/.github/ISSUE_TEMPLATE/---1-report-an-issue.md @@ -14,10 +14,10 @@ assignees: '' Thanks for contributing to Parse Swift! --> -- [ ] I am not disclosing a [vulnerability](https://github.com/parse-community/Parse-Swift/security/policy). +- [ ] I am not disclosing a [vulnerability](https://github.com/parse-community/Parse-SDK-Flutter/security/policy). - [ ] I am not just asking a [question](https://github.com/parse-community/.github/blob/main/SUPPORT.md). -- [ ] I have searched through [existing issues](https://github.com/parse-community/Parse-Swift/issues?q=is%3Aissue). -- [ ] I can reproduce the issue with the [latest version of Parse Swift](https://github.com/parse-community/Parse-Swift/releases). +- [ ] I have searched through [existing issues](https://github.com/parse-community/Parse-SDK-Flutter/issues?q=is%3Aissue). +- [ ] I can reproduce the issue with the [latest version of the Parse Android SDK](https://github.com/parse-community/Parse-SDK-Flutter/releases). - [ ] I can reproduce the issue with the [latest version of Parse Server](https://github.com/parse-community/parse-server/releases). ### Issue Description @@ -32,23 +32,19 @@ assignees: '' ### Expected Outcome -### Failing Test Case / Pull Request +### Pull Request -- [ ] 🤩 I submitted a PR with a fix and a test case. -- [ ] 🧐 I submitted a PR with a failing test case. +- [ ] 🤩 I submitted a PR with a fix. ### Environment -Parse Swift +Parse Flutter SDK - SDK version: `FILL_THIS_OUT` -- Operating system (iOS, macOS, watchOS, etc.): `FILL_THIS_OUT` -- Operating system version: `FILL_THIS_OUT` Server - Parse Server version: `FILL_THIS_OUT` From 1c063af446e264848de8a5f4fcf8884a860b79b8 Mon Sep 17 00:00:00 2001 From: Tom Fox <13188249+TomWFox@users.noreply.github.com> Date: Thu, 5 Aug 2021 00:43:32 +0100 Subject: [PATCH 22/48] Update ---2-feature-request.md --- .github/ISSUE_TEMPLATE/---2-feature-request.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/---2-feature-request.md b/.github/ISSUE_TEMPLATE/---2-feature-request.md index fa5e4e7dd..5e8932e26 100644 --- a/.github/ISSUE_TEMPLATE/---2-feature-request.md +++ b/.github/ISSUE_TEMPLATE/---2-feature-request.md @@ -11,12 +11,12 @@ assignees: '' -- [ ] I am not disclosing a [vulnerability](https://github.com/parse-community/Parse-Swift/security/policy). +- [ ] I am not disclosing a [vulnerability](https://github.com/parse-community/Parse-SDK-Flutter/security/policy). - [ ] I am not just asking a [question](https://github.com/parse-community/.github/blob/main/SUPPORT.md). -- [ ] I have searched through [existing issues](https://github.com/parse-community/Parse-Swift/issues?q=is%3Aissue). +- [ ] I have searched through [existing issues](https://github.com/parse-community/Parse-SDK-Flutter/issues?q=is%3Aissue). ### Current Limitation From c274144cb50efdd873adfd9241f03ff436a8fa5d Mon Sep 17 00:00:00 2001 From: Tom Fox <13188249+TomWFox@users.noreply.github.com> Date: Thu, 5 Aug 2021 00:45:28 +0100 Subject: [PATCH 23/48] Update ---1-report-an-issue.md --- .github/ISSUE_TEMPLATE/---1-report-an-issue.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/ISSUE_TEMPLATE/---1-report-an-issue.md b/.github/ISSUE_TEMPLATE/---1-report-an-issue.md index ece53cb38..6fe5ce84d 100644 --- a/.github/ISSUE_TEMPLATE/---1-report-an-issue.md +++ b/.github/ISSUE_TEMPLATE/---1-report-an-issue.md @@ -11,7 +11,7 @@ assignees: '' - [ ] I am not disclosing a [vulnerability](https://github.com/parse-community/Parse-SDK-Flutter/security/policy). @@ -45,6 +45,8 @@ assignees: '' Parse Flutter SDK - SDK version: `FILL_THIS_OUT` +- Operating system: `FILL_THIS_OUT` +- Operating system version: `FILL_THIS_OUT` Server - Parse Server version: `FILL_THIS_OUT` From e0b29b5ef11e4b52d3161200f672e30808816063 Mon Sep 17 00:00:00 2001 From: Tom Fox <13188249+TomWFox@users.noreply.github.com> Date: Thu, 5 Aug 2021 00:46:12 +0100 Subject: [PATCH 24/48] Update ---1-report-an-issue.md --- .github/ISSUE_TEMPLATE/---1-report-an-issue.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/ISSUE_TEMPLATE/---1-report-an-issue.md b/.github/ISSUE_TEMPLATE/---1-report-an-issue.md index 6fe5ce84d..5cea0261a 100644 --- a/.github/ISSUE_TEMPLATE/---1-report-an-issue.md +++ b/.github/ISSUE_TEMPLATE/---1-report-an-issue.md @@ -17,7 +17,7 @@ assignees: '' - [ ] I am not disclosing a [vulnerability](https://github.com/parse-community/Parse-SDK-Flutter/security/policy). - [ ] I am not just asking a [question](https://github.com/parse-community/.github/blob/main/SUPPORT.md). - [ ] I have searched through [existing issues](https://github.com/parse-community/Parse-SDK-Flutter/issues?q=is%3Aissue). -- [ ] I can reproduce the issue with the [latest version of the Parse Android SDK](https://github.com/parse-community/Parse-SDK-Flutter/releases). +- [ ] I can reproduce the issue with the [latest version of the Parse Flutter SDK](https://github.com/parse-community/Parse-SDK-Flutter/releases). - [ ] I can reproduce the issue with the [latest version of Parse Server](https://github.com/parse-community/parse-server/releases). ### Issue Description From 76fa22813ad9835d14d14730ce1d00999929eef8 Mon Sep 17 00:00:00 2001 From: Manas Malla Date: Tue, 28 Sep 2021 16:15:08 +0530 Subject: [PATCH 25/48] Update Readme.md Updated Readme.md to include information about some extra steps to support for the desktop - macOS platform to connect to the Web and retrive/store information on Parse server due to the changes in the macOS framwork after macOS 10.7 so that user's using the Parse SDK Flutter can get their app running quick and without issues. --- packages/flutter/README.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/packages/flutter/README.md b/packages/flutter/README.md index 8719e274b..9b99a6650 100644 --- a/packages/flutter/README.md +++ b/packages/flutter/README.md @@ -52,6 +52,19 @@ Due to Cross-origin resource sharing (CORS) restrictions, this requires adding ` When running directly via docker, set the env var `PARSE_SERVER_ALLOW_HEADERS=X-Parse-Installation-Id`. When running via express, set [ParseServerOptions](https://parseplatform.org/parse-server/api/master/ParseServerOptions.html) `allowHeaders: ['X-Parse-Installation-Id']`. +#### Desktop Support (macOS) +Due to security entitlements posed by the macOS framework, connecting to the Web and sharing data requires adding the following lines to code : +``` +com.apple.security.network.client + +``` +to the following files: +``` +/macOS/Runner/Release.entitlements +/macOS/Runner/DebugProfile.entitlements +``` +to help the Parse SDK for Flutter communicate with the Web to access the server and send/retrive data. + #### Network client By default, this SDK uses the `ParseHTTPClient`. Another option is use `ParseDioClient`. This client supports the most features (for example a progress callback at the file upload), but a benchmark has shown, that dio is slower than http on web. From 043e7905166bca8f6fd30abcf7bda7dd2d1dc6c1 Mon Sep 17 00:00:00 2001 From: Maximilian Fischer Date: Tue, 16 Nov 2021 13:28:37 +0100 Subject: [PATCH 26/48] docs: fix typo in README (#689) --- packages/dart/README.md | 2 +- packages/flutter/README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/dart/README.md b/packages/dart/README.md index c229992f5..924135a7b 100644 --- a/packages/dart/README.md +++ b/packages/dart/README.md @@ -249,7 +249,7 @@ This method returns an `Future` that either resolves in an error (equivalent of Choosing between `query()` and `find()` comes down to personal preference. Both methods can be used for querying a `ParseQuery`, just the output method differs. -Similar to `find()` the `QueryBuilder` also has a function called `Future? first()`. Just like `find()` `first()` is just a convenience method that makes querying the first object satisfying the query simpler. `first()` returns an `Future`, that resoles in an error or the first object matching the query. In case no object satisfies the query, the result will be `null`. +Similar to `find()` the `QueryBuilder` also has a function called `Future first()`. Just like `find()` `first()` is just a convenience method that makes querying the first object satisfying the query simpler. `first()` returns an `Future`, that resoles in an error or the first object matching the query. In case no object satisfies the query, the result will be `null`. ## Complex queries You can create complex queries to really put your database to the test: diff --git a/packages/flutter/README.md b/packages/flutter/README.md index 9b99a6650..a3761c1e2 100644 --- a/packages/flutter/README.md +++ b/packages/flutter/README.md @@ -279,7 +279,7 @@ This method returns an `Future` that either resolves in an error (equivalent of Choosing between `query()` and `find()` comes down to personal preference. Both methods can be used for querying a `ParseQuery`, just the output method differs. -Similar to `find()` the `QueryBuilder` also has a function called `Future? first()`. Just like `find()` `first()` is just a convenience method that makes querying the first object satisfying the query simpler. `first()` returns an `Future`, that resoles in an error or the first object matching the query. In case no object satisfies the query, the result will be `null`. +Similar to `find()` the `QueryBuilder` also has a function called `Future first()`. Just like `find()` `first()` is just a convenience method that makes querying the first object satisfying the query simpler. `first()` returns an `Future`, that resoles in an error or the first object matching the query. In case no object satisfies the query, the result will be `null`. ## Complex queries You can create complex queries to really put your database to the test: From 3ac7466247af1ce42229e11173f5bcfda93ea462 Mon Sep 17 00:00:00 2001 From: Rodrigo de Souza Marques Date: Mon, 2 May 2022 02:25:49 -0300 Subject: [PATCH 27/48] New version 3.2.0 Fixes for version 3.2.0 --- packages/dart/CHANGELOG.md | 12 ++++++++++++ packages/dart/lib/src/base/parse_constants.dart | 2 +- packages/dart/pubspec.yaml | 4 ++-- packages/flutter/CHANGELOG.md | 12 ++++++++++++ packages/flutter/pubspec.yaml | 14 ++++---------- 5 files changed, 31 insertions(+), 13 deletions(-) diff --git a/packages/dart/CHANGELOG.md b/packages/dart/CHANGELOG.md index be6aaf707..de5d1631b 100644 --- a/packages/dart/CHANGELOG.md +++ b/packages/dart/CHANGELOG.md @@ -1,3 +1,15 @@ +## 3.2.0 +Bug fixes: + * #717 - Old version of connectivity_plus package + * #714 - package_info_plus not work in web + * #712 - MissingPluginException (No implementation found for method getAll) + * #696 - ParseRelation#query - Unhandled Exception: type 'ParseObject' is not a subtype of type + * #679 - Error in progressCallback + * #661 - first: Correct return type + * #653 - ParseLiveListWidget MongoError +Updated dependencies versions +Documentation update + ## 3.1.0 Bug fixes General improvements diff --git a/packages/dart/lib/src/base/parse_constants.dart b/packages/dart/lib/src/base/parse_constants.dart index 8a72eb63e..86bc88267 100644 --- a/packages/dart/lib/src/base/parse_constants.dart +++ b/packages/dart/lib/src/base/parse_constants.dart @@ -1,7 +1,7 @@ part of flutter_parse_sdk; // Library -const String keySdkVersion = '4.0.0'; +const String keySdkVersion = '3.2.0'; const String keyLibraryName = 'Flutter Parse SDK'; // End Points diff --git a/packages/dart/pubspec.yaml b/packages/dart/pubspec.yaml index d7db9fdea..26dc03005 100644 --- a/packages/dart/pubspec.yaml +++ b/packages/dart/pubspec.yaml @@ -1,7 +1,7 @@ name: parse_server_sdk description: Dart plugin for Parse Server, (https://parseplatform.org), (https://back4app.com) -version: 4.0.0 -homepage: https://github.com/phillwiggins/flutter_parse_sdk +version: 3.2.0 +homepage: https://github.com/parse-community/Parse-SDK-Flutter environment: sdk: '>=2.12.0 <3.0.0' diff --git a/packages/flutter/CHANGELOG.md b/packages/flutter/CHANGELOG.md index 4db9f515e..88e45d8f2 100644 --- a/packages/flutter/CHANGELOG.md +++ b/packages/flutter/CHANGELOG.md @@ -1,3 +1,15 @@ +## 3.2.0 +Bug fixes: + * #717 - Old version of connectivity_plus package + * #714 - package_info_plus not work in web + * #712 - MissingPluginException (No implementation found for method getAll) + * #696 - ParseRelation#query - Unhandled Exception: type 'ParseObject' is not a subtype of type + * #679 - Error in progressCallback + * #661 - first: Correct return type + * #653 - ParseLiveListWidget MongoError +Updated dependencies versions +Documentation update + ## 3.1.0 Bug fixes General improvements diff --git a/packages/flutter/pubspec.yaml b/packages/flutter/pubspec.yaml index 80bd164f9..78ef992f7 100644 --- a/packages/flutter/pubspec.yaml +++ b/packages/flutter/pubspec.yaml @@ -1,7 +1,7 @@ name: parse_server_sdk_flutter description: Flutter plugin for Parse Server, (https://parseplatform.org), (https://back4app.com) -version: 4.0.0 -homepage: https://github.com/phillwiggins/flutter_parse_sdk +version: 3.2.0 +homepage: https://github.com/parse-community/Parse-SDK-Flutter environment: sdk: '>=2.12.0 <3.0.0' @@ -11,7 +11,7 @@ dependencies: sdk: flutter #Uncomment for Release version - #parse_server_sdk: ^3.1.0 + parse_server_sdk: ^3.2.0 # Uncomment for local testing #parse_server_sdk: @@ -24,19 +24,13 @@ dependencies: # ref: development # path: packages/dart - parse_server_sdk: - git: - url: https://github.com/RodrigoSMarques/Parse-SDK-Flutter.git - ref: development - path: packages/dart - # Networking dio: ^4.0.6 connectivity_plus: ^2.3.0 # only used in the flutter part #Database shared_preferences: ^2.0.13 # only used in the flutter part - shared_preferences_web: ^2.0.3 + #shared_preferences_web: ^2.0.3 # Utils path_provider: ^2.0.9 # only used in the flutter part From ba13a392e46f1b4978b2ae9f1fc0d10c8177888c Mon Sep 17 00:00:00 2001 From: Rodrigo de Souza Marques Date: Tue, 10 May 2022 00:43:44 -0300 Subject: [PATCH 28/48] Update .gitignore --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index 56909ccd3..aefb6cab4 100644 --- a/.gitignore +++ b/.gitignore @@ -116,3 +116,5 @@ app.*.symbols !**/ios/**/default.perspectivev3 !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages !/dev/ci/**/Gemfile.lock +/packages/flutter/example/linux/flutter/ephemeral/ +/packages/flutter/example/macos/Flutter/ephemeral/ From 6a113981fe8335125ddfbdcd1b29b82fa11adc37 Mon Sep 17 00:00:00 2001 From: Rodrigo de Souza Marques Date: Tue, 10 May 2022 00:46:27 -0300 Subject: [PATCH 29/48] Remove unnecessary files from the project Remove unnecessary files from the project --- .../.plugin_symlinks/connectivity_plus_linux | 1 - .../.plugin_symlinks/package_info_plus_linux | 1 - .../ephemeral/.plugin_symlinks/path_provider_linux | 1 - .../.plugin_symlinks/shared_preferences_linux | 1 - .../Flutter/ephemeral/Flutter-Generated.xcconfig | 12 ------------ .../Flutter/ephemeral/flutter_export_environment.sh | 13 ------------- 6 files changed, 29 deletions(-) delete mode 120000 packages/flutter/example/linux/flutter/ephemeral/.plugin_symlinks/connectivity_plus_linux delete mode 120000 packages/flutter/example/linux/flutter/ephemeral/.plugin_symlinks/package_info_plus_linux delete mode 120000 packages/flutter/example/linux/flutter/ephemeral/.plugin_symlinks/path_provider_linux delete mode 120000 packages/flutter/example/linux/flutter/ephemeral/.plugin_symlinks/shared_preferences_linux delete mode 100644 packages/flutter/example/macos/Flutter/ephemeral/Flutter-Generated.xcconfig delete mode 100755 packages/flutter/example/macos/Flutter/ephemeral/flutter_export_environment.sh diff --git a/packages/flutter/example/linux/flutter/ephemeral/.plugin_symlinks/connectivity_plus_linux b/packages/flutter/example/linux/flutter/ephemeral/.plugin_symlinks/connectivity_plus_linux deleted file mode 120000 index bed50da18..000000000 --- a/packages/flutter/example/linux/flutter/ephemeral/.plugin_symlinks/connectivity_plus_linux +++ /dev/null @@ -1 +0,0 @@ -/Users/rodrigo/flutter/.pub-cache/hosted/pub.dartlang.org/connectivity_plus_linux-1.3.0/ \ No newline at end of file diff --git a/packages/flutter/example/linux/flutter/ephemeral/.plugin_symlinks/package_info_plus_linux b/packages/flutter/example/linux/flutter/ephemeral/.plugin_symlinks/package_info_plus_linux deleted file mode 120000 index 94f271118..000000000 --- a/packages/flutter/example/linux/flutter/ephemeral/.plugin_symlinks/package_info_plus_linux +++ /dev/null @@ -1 +0,0 @@ -/Users/rodrigo/flutter/.pub-cache/hosted/pub.dartlang.org/package_info_plus_linux-1.0.5/ \ No newline at end of file diff --git a/packages/flutter/example/linux/flutter/ephemeral/.plugin_symlinks/path_provider_linux b/packages/flutter/example/linux/flutter/ephemeral/.plugin_symlinks/path_provider_linux deleted file mode 120000 index 15207934e..000000000 --- a/packages/flutter/example/linux/flutter/ephemeral/.plugin_symlinks/path_provider_linux +++ /dev/null @@ -1 +0,0 @@ -/Users/rodrigo/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_linux-2.1.5/ \ No newline at end of file diff --git a/packages/flutter/example/linux/flutter/ephemeral/.plugin_symlinks/shared_preferences_linux b/packages/flutter/example/linux/flutter/ephemeral/.plugin_symlinks/shared_preferences_linux deleted file mode 120000 index d7be94dbb..000000000 --- a/packages/flutter/example/linux/flutter/ephemeral/.plugin_symlinks/shared_preferences_linux +++ /dev/null @@ -1 +0,0 @@ -/Users/rodrigo/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_linux-2.1.0/ \ No newline at end of file diff --git a/packages/flutter/example/macos/Flutter/ephemeral/Flutter-Generated.xcconfig b/packages/flutter/example/macos/Flutter/ephemeral/Flutter-Generated.xcconfig deleted file mode 100644 index 71d954b5c..000000000 --- a/packages/flutter/example/macos/Flutter/ephemeral/Flutter-Generated.xcconfig +++ /dev/null @@ -1,12 +0,0 @@ -// This is a generated file; do not edit or check into version control. -FLUTTER_ROOT=/Users/rodrigo/flutter -FLUTTER_APPLICATION_PATH=/Volumes/SANDISK/Development/Github/Parse-SDK-Flutter/packages/flutter/example -COCOAPODS_PARALLEL_CODE_SIGN=true -FLUTTER_BUILD_DIR=build -FLUTTER_BUILD_NAME=1.0.0 -FLUTTER_BUILD_NUMBER=1 -EXCLUDED_ARCHS=arm64 -DART_OBFUSCATION=false -TRACK_WIDGET_CREATION=false -TREE_SHAKE_ICONS=false -PACKAGE_CONFIG=.packages diff --git a/packages/flutter/example/macos/Flutter/ephemeral/flutter_export_environment.sh b/packages/flutter/example/macos/Flutter/ephemeral/flutter_export_environment.sh deleted file mode 100755 index a5dfb679a..000000000 --- a/packages/flutter/example/macos/Flutter/ephemeral/flutter_export_environment.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/sh -# This is a generated file; do not edit or check into version control. -export "FLUTTER_ROOT=/Users/rodrigo/flutter" -export "FLUTTER_APPLICATION_PATH=/Volumes/SANDISK/Development/Github/Parse-SDK-Flutter/packages/flutter/example" -export "COCOAPODS_PARALLEL_CODE_SIGN=true" -export "FLUTTER_BUILD_DIR=build" -export "FLUTTER_BUILD_NAME=1.0.0" -export "FLUTTER_BUILD_NUMBER=1" -export "EXCLUDED_ARCHS=arm64" -export "DART_OBFUSCATION=false" -export "TRACK_WIDGET_CREATION=false" -export "TREE_SHAKE_ICONS=false" -export "PACKAGE_CONFIG=.packages" From 06f0035957c16fd87dbc7a01d3ecd8c2c5558fc0 Mon Sep 17 00:00:00 2001 From: Rodrigo de Souza Marques Date: Wed, 1 Jun 2022 20:49:22 -0300 Subject: [PATCH 30/48] Merge branch 'master' of https://github.com/parse-community/Parse-SDK-Flutter into parse-community-master --- .../ISSUE_TEMPLATE/---1-report-an-issue.md | 29 +-- .../ISSUE_TEMPLATE/---2-feature-request.md | 7 +- .github/pull_request_template.md | 27 +++ .github/workflows/ci.yml | 131 +++++++++++++ .github/workflows/release-automated.yml | 29 +++ .github/workflows/release-manual.yml | 47 +++++ .gitignore | 4 + .travis.yml | 23 --- README.md | 35 ++-- analysis_options.yaml | 179 ------------------ packages/dart/CHANGELOG.md | 109 +++++++---- packages/dart/README.md | 73 ++++--- packages/dart/analysis_options.yaml | 1 + packages/dart/lib/parse_server_sdk.dart | 2 +- .../dart/lib/src/data/parse_core_data.dart | 3 +- .../lib/src/data/parse_subclass_handler.dart | 16 +- .../dart/lib/src/network/dio_adapter_io.dart | 3 +- .../dart/lib/src/network/parse_client.dart | 4 +- .../lib/src/network/parse_dio_client.dart | 16 +- .../lib/src/network/parse_http_client.dart | 9 +- .../lib/src/network/parse_live_query.dart | 8 +- .../dart/lib/src/network/parse_query.dart | 74 ++++---- packages/dart/lib/src/objects/parse_base.dart | 8 +- .../dart/lib/src/objects/parse_config.dart | 2 +- .../dart/lib/src/objects/parse_error.dart | 2 +- packages/dart/lib/src/objects/parse_file.dart | 2 +- .../dart/lib/src/objects/parse_file_base.dart | 4 +- .../dart/lib/src/objects/parse_file_web.dart | 2 +- .../dart/lib/src/objects/parse_object.dart | 22 +-- .../dart/lib/src/objects/parse_relation.dart | 2 +- packages/dart/lib/src/objects/parse_user.dart | 14 +- .../response/parse_exception_response.dart | 1 - .../response/parse_response_builder.dart | 12 +- .../dart/lib/src/utils/parse_decoder.dart | 4 +- .../dart/lib/src/utils/parse_live_list.dart | 15 +- packages/dart/pubspec.yaml | 3 +- packages/flutter/CHANGELOG.md | 87 +++++---- packages/flutter/README.md | 69 +++++-- packages/flutter/analysis_options.yaml | 28 +++ packages/flutter/example/android/.gitignore | 19 +- .../flutter/example/android/app/build.gradle | 33 ++-- .../android/app/src/debug/AndroidManifest.xml | 7 + .../android/app/src/main/AndroidManifest.xml | 38 ++-- .../flutterpluginexample/BuildConfig.java | 8 - .../flutterpluginexample/Manifest.java | 7 - .../com/example/flutterpluginexample/R.java | 7 - .../flutterpluginexample/MainActivity.java | 9 +- .../res/drawable-v21/launch_background.xml | 12 ++ .../app/src/main/res/values-night/styles.xml | 18 ++ .../app/src/main/res/values/styles.xml | 12 +- .../app/src/profile/AndroidManifest.xml | 7 + packages/flutter/example/android/build.gradle | 8 +- .../flutter/example/android/gradle.properties | 3 +- .../gradle/wrapper/gradle-wrapper.properties | 2 +- .../flutter/example/android/settings.gradle | 18 +- .../diet_plan/provider_api_diet_plan.dart | 4 +- .../diet_plan/provider_db_diet_plan.dart | 12 +- .../repositories/user/provider_db_user.dart | 2 +- packages/flutter/example/lib/main.dart | 8 +- .../example/lib/pages/decision_page.dart | 30 +-- .../flutter/example/lib/pages/home_page.dart | 4 +- .../flutter/example/lib/pages/login_page.dart | 38 ++-- packages/flutter/example/pubspec.yaml | 1 + .../repository_diet_plan_api_test.dart | 8 +- .../repository_diet_plan_db_test.dart | 8 +- .../diet_plan/repository_diet_plan_test.dart | 4 +- .../flutter/example_livelist/lib/main.dart | 18 +- .../flutter/example_livelist/pubspec.yaml | 3 +- packages/flutter/lib/parse_server_sdk.dart | 1 - .../lib/src/utils/parse_live_list.dart | 3 +- packages/flutter/pubspec.yaml | 3 +- .../test/parse_client_configuration_test.dart | 2 +- tools/flutter-dependencies.sh | 11 ++ 73 files changed, 854 insertions(+), 620 deletions(-) create mode 100644 .github/pull_request_template.md create mode 100644 .github/workflows/ci.yml create mode 100644 .github/workflows/release-automated.yml create mode 100644 .github/workflows/release-manual.yml delete mode 100644 .travis.yml delete mode 100644 analysis_options.yaml create mode 100644 packages/flutter/analysis_options.yaml create mode 100644 packages/flutter/example/android/app/src/debug/AndroidManifest.xml delete mode 100644 packages/flutter/example/android/app/src/main/gen/com/example/flutterpluginexample/BuildConfig.java delete mode 100644 packages/flutter/example/android/app/src/main/gen/com/example/flutterpluginexample/Manifest.java delete mode 100644 packages/flutter/example/android/app/src/main/gen/com/example/flutterpluginexample/R.java create mode 100644 packages/flutter/example/android/app/src/main/res/drawable-v21/launch_background.xml create mode 100644 packages/flutter/example/android/app/src/main/res/values-night/styles.xml create mode 100644 packages/flutter/example/android/app/src/profile/AndroidManifest.xml create mode 100644 tools/flutter-dependencies.sh diff --git a/.github/ISSUE_TEMPLATE/---1-report-an-issue.md b/.github/ISSUE_TEMPLATE/---1-report-an-issue.md index 5cea0261a..dfe11cfda 100644 --- a/.github/ISSUE_TEMPLATE/---1-report-an-issue.md +++ b/.github/ISSUE_TEMPLATE/---1-report-an-issue.md @@ -9,16 +9,15 @@ assignees: '' ### New Issue Checklist - [ ] I am not disclosing a [vulnerability](https://github.com/parse-community/Parse-SDK-Flutter/security/policy). - [ ] I am not just asking a [question](https://github.com/parse-community/.github/blob/main/SUPPORT.md). - [ ] I have searched through [existing issues](https://github.com/parse-community/Parse-SDK-Flutter/issues?q=is%3Aissue). -- [ ] I can reproduce the issue with the [latest version of the Parse Flutter SDK](https://github.com/parse-community/Parse-SDK-Flutter/releases). -- [ ] I can reproduce the issue with the [latest version of Parse Server](https://github.com/parse-community/parse-server/releases). +- [ ] I can reproduce the issue with the latest version of [Parse Server](https://github.com/parse-community/parse-server/releases) and the [Parse Flutter SDK](https://github.com/parse-community/Parse-SDK-Flutter/releases). ### Issue Description @@ -27,36 +26,20 @@ assignees: '' ### Actual Outcome - + ### Expected Outcome - + -### Pull Request - - -- [ ] 🤩 I submitted a PR with a fix. - -### Environment +### Environment Parse Flutter SDK - SDK version: `FILL_THIS_OUT` -- Operating system: `FILL_THIS_OUT` - Operating system version: `FILL_THIS_OUT` Server - Parse Server version: `FILL_THIS_OUT` -- Operating system: `FILL_THIS_OUT` -- Local or remote host (AWS, Azure, Google Cloud, Heroku, Digital Ocean, etc): `FILL_THIS_OUT` - -Database -- System (MongoDB or Postgres): `FILL_THIS_OUT` -- Database version: `FILL_THIS_OUT` -- Local or remote host (MongoDB Atlas, mLab, AWS, Azure, Google Cloud, etc): `FILL_THIS_OUT` ### Logs diff --git a/.github/ISSUE_TEMPLATE/---2-feature-request.md b/.github/ISSUE_TEMPLATE/---2-feature-request.md index 5e8932e26..77c685a50 100644 --- a/.github/ISSUE_TEMPLATE/---2-feature-request.md +++ b/.github/ISSUE_TEMPLATE/---2-feature-request.md @@ -9,9 +9,9 @@ assignees: '' ### New Feature / Enhancement Checklist - [ ] I am not disclosing a [vulnerability](https://github.com/parse-community/Parse-SDK-Flutter/security/policy). @@ -29,6 +29,3 @@ assignees: '' ### Alternatives / Workarounds - -### 3rd Party References - diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 000000000..e9e192b2b --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,27 @@ +### New Pull Request Checklist + + +- [ ] I am not disclosing a [vulnerability](https://github.com/parse-community/Parse-SDK-Flutter/security/policy). +- [ ] I am creating this PR in reference to an [issue](https://github.com/parse-community/Parse-SDK-Flutter/issues?q=is%3Aissue). + +### Issue Description + + +Related issue: #`FILL_THIS_OUT` + +### Approach + + +### TODOs before merging + + +- [ ] Add tests +- [ ] Add changes to documentation (guides, repository pages, in-code descriptions) +- [ ] A changelog entry diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 000000000..f56045a45 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,131 @@ +name: ci +on: + push: + branches: + - "master" + - "development" + paths-ignore: + - "**/README.md" + - "docs/**" + pull_request: + branches: + - "**" +jobs: + check-lint-flutter: + name: Lint (flutter) + timeout-minutes: 5 + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v3 + - name: Setup flutter + uses: subosito/flutter-action@v2 + with: + cache: true + - name: Lint + run: flutter format --output=none --set-exit-if-changed packages/flutter + check-lint-dart: + name: Lint (dart) + timeout-minutes: 5 + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v3 + - name: Setup dart + uses: dart-lang/setup-dart@v1 + - name: Lint + run: dart format --output=none --set-exit-if-changed packages/dart + check-code-analysis-flutter: + name: Code analysis (flutter) + timeout-minutes: 5 + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v3 + - name: Setup flutter + uses: subosito/flutter-action@v2 + with: + cache: true + - name: Install dependencies + run: | + echo "publish_to: none" >> packages/flutter/pubspec.yaml + tools/flutter-dependencies.sh + - name: Analyze code + run: flutter analyze packages/flutter --no-fatal-infos + check-code-analysis-dart: + name: Code analysis (dart) + timeout-minutes: 5 + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v3 + - name: Setup dart + uses: dart-lang/setup-dart@v1 + - name: Install dependencies + run: dart pub get --directory packages/dart + - name: Analyze code + run: dart analyze packages/dart + check-flutter: + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest, macos-latest, windows-latest] + fail-fast: false + name: Test flutter (${{ matrix.os }}) + steps: + - name: Checkout code + uses: actions/checkout@v3 + - name: Setup flutter + uses: subosito/flutter-action@v2 + with: + cache: true + - name: Install dependencies + run: tools/flutter-dependencies.sh + - name: Run tests + run: (cd packages/flutter && flutter test --coverage) + - name: Convert code coverage + # Needs to be adapted to collect the coverage at all platforms if platform specific code is added. + if: ${{ always() && matrix.os == 'ubuntu-latest' }} + working-directory: packages/flutter + run: | + escapedPath="$(echo `pwd` | sed 's/\//\\\//g')" + sed "s/^SF:lib/SF:$escapedPath\/lib/g" coverage/lcov.info > coverage/lcov-full.info + - name: Upload code coverage + uses: codecov/codecov-action@v2 + # Needs to be adapted to collect the coverage at all platforms if platform specific code is added. + if: ${{ always() && matrix.os == 'ubuntu-latest' }} + with: + files: packages/flutter/coverage/lcov-full.info + fail_ci_if_error: true + check-dart: + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest, macos-latest, windows-latest] + fail-fast: false + name: Test dart (${{ matrix.os }}) + steps: + - name: Checkout code + uses: actions/checkout@v3 + - name: Setup dart + uses: dart-lang/setup-dart@v1 + - name: Install dependencies + run: dart pub get --directory packages/dart + - name: Run build_runner + run: (cd packages/dart && dart run build_runner build --delete-conflicting-outputs) + - name: Run tests + run: (cd packages/dart && dart test --coverage=coverage) + - name: Convert code coverage + # Needs to be adapted to collect the coverage at all platforms if platform specific code is added. + if: ${{ always() && matrix.os == 'ubuntu-latest' }} + working-directory: packages/dart + run: | + dart pub global activate coverage + dart pub global run coverage:format_coverage -i coverage/test -o coverage/lcov.info --lcov --packages=.dart_tool/package_config.json --report-on=lib + - name: Upload code coverage + uses: codecov/codecov-action@v2 + # Needs to be adapted to collect the coverage at all platforms if platform specific code is added. + if: ${{ always() && matrix.os == 'ubuntu-latest' }} + with: + files: packages/dart/coverage/lcov.info + fail_ci_if_error: true diff --git a/.github/workflows/release-automated.yml b/.github/workflows/release-automated.yml new file mode 100644 index 000000000..3a3257368 --- /dev/null +++ b/.github/workflows/release-automated.yml @@ -0,0 +1,29 @@ +name: release-automated +on: + release: + types: [ published ] +jobs: + release: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v3 + - name: Publish dart package + if: ${{ startsWith(github.ref_name, 'dart') }} + uses: k-paxian/dart-package-publisher@v1.4 + with: + accessToken: ${{ secrets.PUBDEV_GOOGLE_ACCOUNT_ACCESS_TOKEN }} + refreshToken: ${{ secrets.PUBDEV_GOOGLE_ACCOUNT_REFRESH_TOKEN }} + relativePath: packages/dart + format: true + dryRunOnly: false + - name: Publish flutter package + if: ${{ startsWith(github.ref_name, 'flutter') }} + uses: k-paxian/dart-package-publisher@v1.4 + with: + accessToken: ${{ secrets.PUBDEV_GOOGLE_ACCOUNT_ACCESS_TOKEN }} + refreshToken: ${{ secrets.PUBDEV_GOOGLE_ACCOUNT_REFRESH_TOKEN }} + relativePath: packages/flutter + flutter: true + format: true + dryRunOnly: false diff --git a/.github/workflows/release-manual.yml b/.github/workflows/release-manual.yml new file mode 100644 index 000000000..909ad83ad --- /dev/null +++ b/.github/workflows/release-manual.yml @@ -0,0 +1,47 @@ +# Trigger this workflow only to manually create a dart/flutter release; this should only be used +# in extraordinary circumstances, as dart/flutter releases are normally created automatically as +# part of the automated release workflow. + +name: release-manual +on: + workflow_dispatch: + inputs: + ref: + description: 'Reference (tag / SHA):' + required: true + default: '' + package: + description: 'Package' + required: true + default: '' + type: choice + options: + - dart + - flutter +jobs: + release: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v3 + with: + ref: ${{ github.event.inputs.ref }} + - name: Publish dart package + if: github.event.inputs.package == 'dart' + uses: k-paxian/dart-package-publisher@v1.4 + with: + accessToken: ${{ secrets.PUBDEV_GOOGLE_ACCOUNT_ACCESS_TOKEN }} + refreshToken: ${{ secrets.PUBDEV_GOOGLE_ACCOUNT_REFRESH_TOKEN }} + relativePath: packages/dart + format: true + dryRunOnly: false + - name: Publish flutter package + if: github.event.inputs.package == 'flutter' + uses: k-paxian/dart-package-publisher@v1.4 + with: + accessToken: ${{ secrets.PUBDEV_GOOGLE_ACCOUNT_ACCESS_TOKEN }} + refreshToken: ${{ secrets.PUBDEV_GOOGLE_ACCOUNT_REFRESH_TOKEN }} + relativePath: packages/flutter + flutter: true + format: true + dryRunOnly: false diff --git a/.gitignore b/.gitignore index aefb6cab4..2c60b1faf 100644 --- a/.gitignore +++ b/.gitignore @@ -103,8 +103,12 @@ unlinked_spec.ds # macOS **/macos/Flutter/GeneratedPluginRegistrant.swift +# Linux +**/linux/flutter/ephemeral + # Coverage coverage/ +lcov.info # Symbols app.*.symbols diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 45d165edc..000000000 --- a/.travis.yml +++ /dev/null @@ -1,23 +0,0 @@ -language: dart - -dart: - - stable - - dev - -install: - - git clone https://github.com/flutter/flutter.git -b stable --depth 1 - - export PATH=~/build/parse-community/Parse-SDK-Flutter/flutter/bin:$PATH - - flutter doctor - -script: - - (cd packages/dart && pub get) - - (cd packages/dart && dart run build_runner build --delete-conflicting-outputs) - - (cd packages/dart && pub run test) - - (cd packages/flutter && flutter pub remove parse_server_sdk) - - (cd packages/flutter && flutter pub add parse_server_sdk --path ../dart) - - (cd packages/flutter && flutter pub get) - - (cd packages/flutter && flutter test --no-pub test/) - -cache: - directories: - - "$HOME/.pub-cache" diff --git a/README.md b/README.md index 3de7ab640..85a870dda 100644 --- a/README.md +++ b/README.md @@ -1,24 +1,27 @@ -

- Parse Logo - -

+![parse-repository-header-sdk-flutterdart](https://user-images.githubusercontent.com/5673677/166121476-3838ac9f-a437-409c-bb28-6e1dfcc36b1c.png) --- -This repository contains packages that allow communication with a Parse Server, -(https://parseplatform.org) either hosted on your own server or another, -like (http://Back4App.com). +[![Build Status](https://github.com/parse-community/Parse-SDK-Flutter/workflows/ci/badge.svg?branch=master)](https://github.com/parse-community/Parse-SDK-Flutter/actions?query=workflow%3Aci+branch%3Amaster) +[![Coverage](https://img.shields.io/codecov/c/github/parse-community/Parse-SDK-Flutter/master)](https://app.codecov.io/gh/parse-community/Parse-SDK-Flutter/branch/master) -This is a work in progress and we are consistently updating it. Please let us know if you think anything needs changing/adding, and more than ever, please do join in on this project. (Even if it is just to improve our documentation) +[![Backers on Open Collective](https://opencollective.com/parse-server/backers/badge.svg)][open-collective-link] +[![Sponsors on Open Collective](https://opencollective.com/parse-server/sponsors/badge.svg)][open-collective-link] +[![License](https://img.shields.io/badge/license-BSD-lightgrey.svg)](https://github.com/parse-community/Parse-SDK-Android/blob/master/LICENSE) +[![Forum](https://img.shields.io/discourse/https/community.parseplatform.org/topics.svg)](https://community.parseplatform.org/c/parse-server) +[![Twitter Follow](https://img.shields.io/twitter/follow/ParsePlatform.svg?label=Follow%20us&style=social)](https://twitter.com/intent/follow?screen_name=ParsePlatform) -## Packages +--- + +These libraries give you access to the powerful Parse Server backend from your Dart/Flutter app. For more information about Parse Platform and its features visit [parseplatform.org](https://parseplatform.org/). + +# Packages -These are the available packages in this repository. +These packages are available in this repository: -| Plugin | Pub | explanation| -|--------|-----|------------| -| [parse_server_sdk](./packages/dart) | [![pub package](https://img.shields.io/pub/v/parse_server_sdk.svg)](https://pub.dev/packages/parse_server_sdk) | a dart package that lets you communicate with the parse server | -| [parse_server_sdk_flutter](./packages/flutter) | [![pub package](https://img.shields.io/pub/v/parse_server_sdk_flutter.svg)](https://pub.dev/packages/parse_server_sdk_flutter) | a flutter package that lets you communicate with the parse server | +| Type | Name | Pub | +|---------|------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| Dart | [parse_server_sdk](./packages/dart) | [![pub package](https://img.shields.io/pub/v/parse_server_sdk.svg)](https://pub.dev/packages/parse_server_sdk) [![likes](https://badges.bar/parse_server_sdk/likes)](https://pub.dev/packages/parse_server_sdk/score) [![popularity](https://badges.bar/parse_server_sdk/popularity)](https://pub.dev/packages/parse_server_sdk/score) [![pub points](https://badges.bar/parse_server_sdk/pub%20points)](https://pub.dev/packages/parse_server_sdk/score) | +| Flutter | [parse_server_sdk_flutter](./packages/flutter) | [![pub package](https://img.shields.io/pub/v/parse_server_sdk_flutter.svg)](https://pub.dev/packages/parse_server_sdk_flutter) [![likes](https://badges.bar/parse_server_sdk_flutter/likes)](https://pub.dev/packages/parse_server_sdk_flutter/score) [![popularity](https://badges.bar/parse_server_sdk_flutter/popularity)](https://pub.dev/packages/parse_server_sdk_flutter/score) [![pub points](https://badges.bar/parse_server_sdk_flutter/pub%20points)](https://pub.dev/packages/parse_server_sdk_flutter/score) | -### Author:- -This project was authored by Phill Wiggins. You can contact me at phill.wiggins@gmail.com +[open-collective-link]: https://opencollective.com/parse-server diff --git a/analysis_options.yaml b/analysis_options.yaml deleted file mode 100644 index bb1a51614..000000000 --- a/analysis_options.yaml +++ /dev/null @@ -1,179 +0,0 @@ -# Specify analysis options. -# -# Until there are meta linter rules, each desired lint must be explicitly enabled. -# See: https://github.com/dart-lang/linter/issues/288 -# -# For a list of lints, see: http://dart-lang.github.io/linter/lints/ -# See the configuration guide for more -# https://github.com/dart-lang/sdk/tree/master/pkg/analyzer#configuring-the-analyzer -# -# There are other similar analysis options files in the flutter repos, -# which should be kept in sync with this file: -# -# - analysis_options.yaml (this file) -# - packages/flutter/lib/analysis_options_user.yaml -# - https://github.com/flutter/plugins/blob/master/analysis_options.yaml -# - https://github.com/flutter/engine/blob/master/analysis_options.yaml -# -# This file contains the analysis options used by Flutter tools, such as IntelliJ, -# Android Studio, and the `flutter analyze` command. - -analyzer: - strong-mode: - implicit-dynamic: false - errors: - # treat missing required parameters as a warning (not a hint) - missing_required_param: warning - # treat missing returns as a warning (not a hint) - missing_return: warning - # allow having TODOs in the code - todo: ignore - # Ignore analyzer hints for updating pubspecs when using Future or - # Stream and not importing dart:async - # Please see https://github.com/flutter/flutter/pull/24528 for details. - sdk_version_async_exported_from_core: ignore - exclude: - - 'bin/cache/**' - # the following two are relative to the stocks example and the flutter package respectively - # see https://github.com/dart-lang/sdk/issues/28463 - - 'lib/i18n/stock_messages_*.dart' - - 'lib/src/http/**' - -linter: - rules: - # these rules are documented on and in the same order as - # the Dart Lint rules page to make maintenance easier - # https://github.com/dart-lang/linter/blob/master/example/all.yaml - - always_declare_return_types - - always_put_control_body_on_new_line - # - always_put_required_named_parameters_first # we prefer having parameters in the same order as fields https://github.com/flutter/flutter/issues/10219 - - always_require_non_null_named_parameters - - always_specify_types - - annotate_overrides - # - avoid_annotating_with_dynamic # conflicts with always_specify_types - - avoid_as - # - avoid_bool_literals_in_conditional_expressions # not yet tested - # - avoid_catches_without_on_clauses # we do this commonly - # - avoid_catching_errors # we do this commonly - - avoid_classes_with_only_static_members - # - avoid_double_and_int_checks # only useful when targeting JS runtime - - avoid_empty_else - - avoid_field_initializers_in_const_classes - - avoid_function_literals_in_foreach_calls - # - avoid_implementing_value_types # not yet tested - - avoid_init_to_null - # - avoid_js_rounded_ints # only useful when targeting JS runtime - - avoid_null_checks_in_equality_operators - # - avoid_positional_boolean_parameters # not yet tested - # - avoid_private_typedef_functions # we prefer having typedef (discussion in https://github.com/flutter/flutter/pull/16356) - - avoid_relative_lib_imports - - avoid_renaming_method_parameters - - avoid_return_types_on_setters - # - avoid_returning_null # there are plenty of valid reasons to return null - # - avoid_returning_null_for_future # not yet tested - - avoid_returning_null_for_void - # - avoid_returning_this # there are plenty of valid reasons to return this - # - avoid_setters_without_getters # not yet tested - # - avoid_shadowing_type_parameters # not yet tested - # - avoid_single_cascade_in_expression_statements # not yet tested - - avoid_slow_async_io - - avoid_types_as_parameter_names - # - avoid_types_on_closure_parameters # conflicts with always_specify_types - - avoid_unused_constructor_parameters - - avoid_void_async - - await_only_futures - - camel_case_types - - cancel_subscriptions - # - cascade_invocations # not yet tested - # - close_sinks # not reliable enough - # - comment_references # blocked on https://github.com/flutter/flutter/issues/20765 - # - constant_identifier_names # needs an opt-out https://github.com/dart-lang/linter/issues/204 - - control_flow_in_finally - # - curly_braces_in_flow_control_structures # not yet tested - - directives_ordering - - empty_catches - - empty_constructor_bodies - - empty_statements - # - file_names # not yet tested - - flutter_style_todos - - hash_and_equals - - implementation_imports - # - invariant_booleans # too many false positives: https://github.com/dart-lang/linter/issues/811 - - iterable_contains_unrelated_type - # - join_return_with_assignment # not yet tested - - library_names - - library_prefixes - # - lines_longer_than_80_chars # not yet tested - - list_remove_unrelated_type - # - literal_only_boolean_expressions # too many false positives: https://github.com/dart-lang/sdk/issues/34181 - - no_adjacent_strings_in_list - - no_duplicate_case_values - - non_constant_identifier_names - # - null_closures # not yet tested - # - omit_local_variable_types # opposite of always_specify_types - # - one_member_abstracts # too many false positives - # - only_throw_errors # https://github.com/flutter/flutter/issues/5792 - - overridden_fields - - package_api_docs - - package_names - - package_prefixed_library_names - # - parameter_assignments # we do this commonly - - prefer_adjacent_string_concatenation - - prefer_asserts_in_initializer_lists - # - prefer_collection_literals # temporary until all platforms support set literals - - prefer_conditional_assignment - - prefer_const_constructors - - prefer_const_constructors_in_immutables - - prefer_const_declarations - - prefer_const_literals_to_create_immutables - # - prefer_constructors_over_static_methods # not yet tested - - prefer_contains - - prefer_equal_for_default_values - # - prefer_expression_function_bodies # conflicts with https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo#consider-using--for-short-functions-and-methods - - prefer_final_fields - - prefer_final_locals - - prefer_foreach - # - prefer_function_declarations_over_variables # not yet tested - - prefer_generic_function_type_aliases - - prefer_initializing_formals - # - prefer_int_literals # not yet tested - # - prefer_interpolation_to_compose_strings # not yet tested - - prefer_is_empty - - prefer_is_not_empty - - prefer_iterable_whereType - # - prefer_mixin # https://github.com/dart-lang/language/issues/32 - - prefer_single_quotes - - prefer_typing_uninitialized_variables - - prefer_void_to_null - # - public_member_api_docs # enabled on a case-by-case basis; see e.g. packages/analysis_options.yaml - - recursive_getters - - slash_for_doc_comments - - sort_constructors_first - - sort_pub_dependencies - - sort_unnamed_constructors_first - # - super_goes_last # no longer needed w/ Dart 2 - - test_types_in_equals - - throw_in_finally - # - type_annotate_public_apis # subset of always_specify_types - - type_init_formals - # - unawaited_futures # too many false positives - # - unnecessary_await_in_return # not yet tested - - unnecessary_brace_in_string_interps - - unnecessary_const - - unnecessary_getters_setters - # - unnecessary_lambdas # has false positives: https://github.com/dart-lang/linter/issues/498 - - unnecessary_new - - unnecessary_null_aware_assignments - - unnecessary_null_in_if_null_operators - - unnecessary_overrides - - unnecessary_parenthesis - - unnecessary_statements - - unnecessary_this - - unrelated_type_equality_checks - # - use_function_type_syntax_for_parameters # not yet tested - - use_rethrow_when_possible - # - use_setters_to_change_properties # not yet tested - # - use_string_buffers # has false positives: https://github.com/dart-lang/sdk/issues/34182 - # - use_to_and_as_if_applicable # has false positives, so we prefer to catch this by code-review - - valid_regexps - # - void_checks # not yet tested \ No newline at end of file diff --git a/packages/dart/CHANGELOG.md b/packages/dart/CHANGELOG.md index de5d1631b..b90e82bba 100644 --- a/packages/dart/CHANGELOG.md +++ b/packages/dart/CHANGELOG.md @@ -1,122 +1,157 @@ -## 3.2.0 -Bug fixes: - * #717 - Old version of connectivity_plus package - * #714 - package_info_plus not work in web - * #712 - MissingPluginException (No implementation found for method getAll) - * #696 - ParseRelation#query - Unhandled Exception: type 'ParseObject' is not a subtype of type - * #679 - Error in progressCallback - * #661 - first: Correct return type - * #653 - ParseLiveListWidget MongoError -Updated dependencies versions -Documentation update - -## 3.1.0 -Bug fixes -General improvements -Updated dependencies +## [3.1.1](https://github.com/parse-community/Parse-SDK-Flutter/compare/V3.1.0...dart-3.1.1) (2022-05-30) -## 3.0.0 -Stable null safety release. +### Refactors -## 2.1.0 -Option para uses ParseHTTPClient (default) or ParseDioClient (slow on Flutter Web). - **BREAKING CHANGE** if use progress callback at the file upload in version 2.0.1 -Added method excludeKeys: Exclude specific fields from the returned query -Changed to the method POST on Login -Bug fixes -General improvements -Updated dependencies +* fix analyzer code style warnings ([#733](https://github.com/parse-community/Parse-SDK-Flutter/issues/733)) + +# [3.1.0](https://github.com/parse-community/Parse-SDK-Flutter/compare/V3.0.0...V3.1.0) (2021-06-28) + +### Bug Fixes + +* General improvements +* Updated dependencies + +# [3.0.0](https://github.com/parse-community/Parse-SDK-Flutter/compare/2.1.0...V3.0.0) (2021-04-14) + +### Bug Fixes + +* Stable null safety release + +# [2.1.0](https://github.com/parse-community/Parse-SDK-Flutter/compare/2.0.1...2.1.0) (2021-02-18) + +### BREAKING CHANGES + +* Changed to HTTP method POST for login +* Change in progress callback for file upload + +### Features + +* Option to use `ParseHTTPClient` (default) or `ParseDioClient` (slow on Flutter Web) +* Added method excludeKeys to exclude specific fields from the returned query + +### Bug Fixes + +* General improvements +* Updated dependencies + +## [2.0.1](https://github.com/parse-community/Parse-SDK-Flutter/compare/2.0.0...2.0.1) (2020-10-24) + +### Bug Fixes + +* Fixed network exceptions ([#482](https://github.com/parse-community/Parse-SDK-Flutter/pull/482)) + +## [2.0.0](https://github.com/parse-community/Parse-SDK-Flutter/compare/1.0.28...2.0.0) (2020-10-13) + +### BREAKING CHANGES + +* From this release onwards the previous repository has been separated into a pure dart (parse_server_sdk) and a flutter package (parse_server_sdk_flutter). This was done in order to provide a dart package for the parse-server, while keeping maintenance simple. You can find both packages in the package directory. If you are using flutter you should migrate using [this guide](https://github.com/parse-community/Parse-SDK-Flutter/blob/release/2.0.0/docs/migrate-2-0-0.md). + +### Features -## 2.0.1 -Fixed network exceptions. [#482](https://github.com/parse-community/Parse-SDK-Flutter/pull/482) +* Added full web support +* Moved ParseHTTPClient to Dio [#459](https://github.com/parse-community/Parse-SDK-Flutter/pull/459) -## 2.0.0 -##### Warning: This release contains breaking changes. If you are using flutter you should migrate using *[this](https://github.com/parse-community/Parse-SDK-Flutter/blob/release/2.0.0/docs/migrate-2-0-0.md)* guide. +### Bug Fixes -- Added full web support -- split this package in a dart and a flutter one - - [flutter package](https://pub.dev/packages/parse_server_sdk_flutter) - - [dart package](https://pub.dev/packages/parse_server_sdk) -- Moved ParseHTTPClient to Dio [#459](https://github.com/parse-community/Parse-SDK-Flutter/pull/459) -- Bug fixes -- general improvements +* General improvements ## 1.0.28 + 1.0.28 was renamed to 2.0.0 ## 1.0.27 + User login / signUp / loginAnonymous delete SessionId stored in device before calling server ## 1.0.26 + LiveList Bug fixes Sembast update ## 1.0.25 + Update dependencies ## 1.0.24 + Fixed lint ## 1.0.23 + Fixed LiveQuery Bug fixes ## 1.0.22 + Added dirty children Added option of sembast or share_preferences ## 1.0.21 + LiveQuery fix Logout fix ## 1.0.20 + ACL now working emailVerified ## 1.0.19 + Bug fix ## 1.0.18 + Bug fix ## 1.0.17 + LiveQuery fix Bug fixes ## 1.0.16 + Bug fixes Fixed object delete Added port support ## 1.0.15 + Fixed 'full' bool issue ## 1.0.14 + Corrected delete & path issue Added Geo queries Added ability to add login oAuth data ## 1.0.13 + Added full bool to convert objects to JSON correctly ## 1.0.12 + Fixed logout ## 1.0.11 + ParseFile fixed Anonymous login SecurityContext CloudFunctions with objects ## 1.0.10 + Add ParseConfig. Fixed whereEqualsTo('', PARSEOBJECT) and other queries ## 1.0.9 + Fixed Health Check issue ## 1.0.8 + Fixed some queries ## 1.0.7 diff --git a/packages/dart/README.md b/packages/dart/README.md index 924135a7b..766f358e0 100644 --- a/packages/dart/README.md +++ b/packages/dart/README.md @@ -1,20 +1,39 @@ -

- Parse Logo - Dart Logo -

+![parse-repository-header-sdk-dart](https://user-images.githubusercontent.com/5673677/166120960-ea1f58e3-a62b-4770-b541-f64186859339.png) --- -**This is now a dart package. The Flutter package was moved [here](https://pub.dev/packages/parse_server_sdk_flutter).** -If you are using flutter you should migrate using [this](https://github.com/parse-community/Parse-SDK-Flutter/blob/release/2.0.0/docs/migrate-2-0-0.md) guide. +This library gives you access to the powerful Parse Server backend from your Dart app. For more information on Parse Platform and its features, visit [parseplatform.org](https://parseplatform.org). The Flutter package was moved [here](https://pub.dev/packages/parse_server_sdk_flutter). If you are using Flutter see [this guide](https://github.com/parse-community/Parse-SDK-Flutter/blob/release/2.0.0/docs/migrate-2-0-0.md) for how to migrate. -**THIS README IS WORK IN PROGRESS!** -Help out to improve this README on [GitHub](https://github.com/parse-community/Parse-SDK-Flutter/edit/master/packages/dart/README.md). +--- -## Parse For Dart! -This is a Dart package that allows communication with a Parse Server, (https://parseplatform.org) either hosted on your own server or another, like (http://Back4App.com). +- [Getting Started](#getting-started) + - [Early Web support](#early-web-support) +- [Objects](#objects) +- [Custom Objects](#custom-objects) +- [Add New Values to Objects](#add-new-values-to-objects) +- [Save Objects using Pins](#save-objects-using-pins) +- [Storage](#storage) +- [Increment Counter Values](#increment-counter-values) +- [Array Operator in Objects](#array-operator-in-objects) +- [Queries](#queries) + - [Alternative Query Methods](#alternative-query-methods) +- [Complex Queries](#complex-queries) +- [Relational queries](#relational-queries) +- [Counting objects](#counting-objects) +- [LiveQuery](#livequery) +- [ParseLiveList](#parselivelist) + - [General Use](#general-use) + - [Included Sub-Objects](#included-sub-objects) +- [Users](#users) +- [Facebook, OAuth and 3rd Party Login/User](#facebook-oauth-and-3rd-party-loginuser) +- [Security for Objects - ParseACL](#security-for-objects---parseacl) +- [Config](#config) +- [Cloud Functions](#cloud-functions) +- [Relation](#relation) +- [File](#file) +- [Other Features](#other-features) -This is a work in progress and we are consistently updating it. Please let us know if you think anything needs changing/adding, and more than ever, please do join in on this project. (Even if it is just to improve our documentation) +--- ## Getting Started @@ -151,7 +170,7 @@ Providing a `ParseObject` as described above should still work, even if you have For custom file classes have a lock at [here](#File). -## Add new values to objects +## Add New Values to Objects To add a variable to an object call and retrieve it, call ```dart @@ -159,7 +178,8 @@ dietPlan.set('RandomInt', 8); var randomInt = dietPlan.get('RandomInt'); ``` -## Save objects using pins +## Save Objects using Pins + You can now save an object by calling `.pin()` on an instance of an object ```dart @@ -173,6 +193,7 @@ var dietPlan = DietPlan().fromPin('OBJECT ID OF OBJECT'); ``` ## Storage + We now have 2 types of storage, secure and unsecure. We currently rely on 2 third party options: - SharedPreferences @@ -183,7 +204,8 @@ The storage method is defined in the parameter __coreStore__ in Parse().initial Check sample code for options -## Increment Counter values in objects +## Increment Counter Values + Retrieve it, call ```dart @@ -199,7 +221,8 @@ var response = dietPlan.save() ``` -## Array Operator in objects +## Array Operator in Objects + Retrieve it, call ```dart @@ -242,7 +265,7 @@ if (dietPlan.success) { } ``` -### Alternative query methods +### Alternative Query Methods The standard query method `query()` returns a `ParseResponse` that contains the result or the error. As an alternative, you can also use `Future> find()` for receiving options. This method returns an `Future` that either resolves in an error (equivalent of the error in the `ParseResponse`) or an `List` containing the queried objects. One difference, you should be aware of, is the fact, that `Future> find()` will return an empty list instead of the 'No results' error you receive in case no object matches you query. @@ -251,7 +274,7 @@ Choosing between `query()` and `find()` comes down to personal preference. Both Similar to `find()` the `QueryBuilder` also has a function called `Future first()`. Just like `find()` `first()` is just a convenience method that makes querying the first object satisfying the query simpler. `first()` returns an `Future`, that resoles in an error or the first object matching the query. In case no object satisfies the query, the result will be `null`. -## Complex queries +## Complex Queries You can create complex queries to really put your database to the test: ```dart @@ -395,7 +418,7 @@ QueryBuilder groupsWithRoleX = var apiResponse = await groupsWithRoleX.query(); ``` -## Counting Objects +## Counting objects If you only care about the number of games played by a particular player: ```dart @@ -408,7 +431,8 @@ if (apiResponse.success && apiResponse.result != null) { } ``` -## Live Queries +## LiveQuery + This tool allows you to subscribe to a QueryBuilder you are interested in. Once subscribed, the server will notify clients whenever a ParseObject that matches the QueryBuilder is created or updated, in real-time. @@ -551,7 +575,8 @@ ParseLiveList makes implementing a dynamic List as simple as possible. It ships with the ParseLiveList class itself, this class manages all elements of the list, sorts them, keeps itself up to date and Notifies you on changes. -### included Sub-Objects +### Included Sub-Objects + By default, ParseLiveQuery will provide you with all the objects you included in your Query like this: ```dart queryBuilder.includeObject(/*List of all the included sub-objects*/); @@ -564,6 +589,7 @@ Just as QueryBuilder, ParseLiveList supports nested sub-objects too. **NOTE:** To use this features you have to enable [Live Queries](#live-queries) first. ## Users + You can create and control users just as normal using this SDK. To register a user, first create one : @@ -835,7 +861,9 @@ await someParseObject.save(); //progressCallback example file.upload(progressCallback: (int count, int total) => print("$count of $total")); ``` -## Other Features of this library + +## Other Features + Main: * Installation (View the example application) * GeoPoints (View the example application) @@ -852,6 +880,3 @@ Objects: * Create new object * Extend Parse Object and create local objects that can be saved and retreived * Queries - -## Author:- -This project was authored by Phill Wiggins. You can contact me at phill.wiggins@gmail.com diff --git a/packages/dart/analysis_options.yaml b/packages/dart/analysis_options.yaml index e69de29bb..572dd239d 100644 --- a/packages/dart/analysis_options.yaml +++ b/packages/dart/analysis_options.yaml @@ -0,0 +1 @@ +include: package:lints/recommended.yaml diff --git a/packages/dart/lib/parse_server_sdk.dart b/packages/dart/lib/parse_server_sdk.dart index ff6556b15..180f27372 100644 --- a/packages/dart/lib/parse_server_sdk.dart +++ b/packages/dart/lib/parse_server_sdk.dart @@ -139,7 +139,7 @@ class Parse { bool hasParseBeenInitialized() => _hasBeenInitialized; - Future healthCheck( + Future healthCheck( {bool? debug, ParseClient? client, bool? sendSessionIdByDefault}) async { final bool _debug = isDebugEnabled(objectLevelDebug: debug); diff --git a/packages/dart/lib/src/data/parse_core_data.dart b/packages/dart/lib/src/data/parse_core_data.dart index 82e3a73c4..aea6adf36 100644 --- a/packages/dart/lib/src/data/parse_core_data.dart +++ b/packages/dart/lib/src/data/parse_core_data.dart @@ -67,7 +67,8 @@ class ParseCoreData { _instance.clientCreator = clientCreator ?? (({required bool sendSessionId, SecurityContext? securityContext}) => ParseHTTPClient( - sendSessionId: sendSessionId, securityContext: securityContext)); + sendSessionId: sendSessionId, + securityContext: securityContext)); } String applicationId; diff --git a/packages/dart/lib/src/data/parse_subclass_handler.dart b/packages/dart/lib/src/data/parse_subclass_handler.dart index 2205abc7c..f7ed18cf9 100644 --- a/packages/dart/lib/src/data/parse_subclass_handler.dart +++ b/packages/dart/lib/src/data/parse_subclass_handler.dart @@ -12,30 +12,34 @@ class ParseSubClassHandler { {Map? registeredSubClassMap, ParseUserConstructor? parseUserConstructor, ParseFileConstructor? parseFileConstructor}) { - _subClassMap = - registeredSubClassMap ?? Map(); + _subClassMap = registeredSubClassMap ?? {}; _parseUserConstructor = parseUserConstructor; - if (parseFileConstructor != null) + if (parseFileConstructor != null) { _parseFileConstructor = parseFileConstructor; + } } late Map _subClassMap; ParseUserConstructor? _parseUserConstructor; - ParseFileConstructor _parseFileConstructor = ({String? name, String? url}) { + ParseFileConstructor _parseFileConstructor = defaultParseFileConstructor; + + static ParseFileBase defaultParseFileConstructor( + {String? name, String? url}) { if (parseIsWeb) { return ParseWebFile(null, name: name!, url: url); } else { return ParseFile(null, name: name, url: url); } - }; + } void registerSubClass( String className, ParseObjectConstructor objectConstructor) { if (className != keyClassUser && className != keyClassInstallation && className != keyClassSession && - className != keyFileClassname) + className != keyFileClassname) { _subClassMap[className] = objectConstructor; + } } void registerUserSubClass(ParseUserConstructor parseUserConstructor) { diff --git a/packages/dart/lib/src/network/dio_adapter_io.dart b/packages/dart/lib/src/network/dio_adapter_io.dart index e8e509560..e0dd6bc17 100644 --- a/packages/dart/lib/src/network/dio_adapter_io.dart +++ b/packages/dart/lib/src/network/dio_adapter_io.dart @@ -7,8 +7,9 @@ HttpClientAdapter createHttpClientAdapter(SecurityContext? securityContext) { final DefaultHttpClientAdapter defaultHttpClientAdapter = DefaultHttpClientAdapter(); - if (securityContext != null) + if (securityContext != null) { defaultHttpClientAdapter.onHttpClientCreate = (HttpClient client) => HttpClient(context: securityContext); + } return defaultHttpClientAdapter; } diff --git a/packages/dart/lib/src/network/parse_client.dart b/packages/dart/lib/src/network/parse_client.dart index 9f540bbb3..bf8c30f04 100644 --- a/packages/dart/lib/src/network/parse_client.dart +++ b/packages/dart/lib/src/network/parse_client.dart @@ -24,7 +24,7 @@ abstract class ParseClient { Future postBytes( String path, { - Stream >? data, + Stream>? data, ParseNetworkOptions? options, ProgressCallback? onSendProgress, }); @@ -62,7 +62,7 @@ abstract class ParseClient { // ParseNetworkOptions options, // }); - @deprecated + @Deprecated("Use ParseCoreData() instead.") ParseCoreData get data => ParseCoreData(); } diff --git a/packages/dart/lib/src/network/parse_dio_client.dart b/packages/dart/lib/src/network/parse_dio_client.dart index 6a55e5bd6..a28483155 100644 --- a/packages/dart/lib/src/network/parse_dio_client.dart +++ b/packages/dart/lib/src/network/parse_dio_client.dart @@ -128,7 +128,8 @@ class ParseDioClient extends ParseClient { /// Creates a custom version of HTTP Client that has Parse Data Preset class _ParseDioClient with dio.DioMixin implements dio.Dio { - _ParseDioClient({bool sendSessionId = false, SecurityContext? securityContext}) + _ParseDioClient( + {bool sendSessionId = false, SecurityContext? securityContext}) : _sendSessionId = sendSessionId { options = dio.BaseOptions(); httpClientAdapter = createHttpClientAdapter(securityContext); @@ -158,18 +159,21 @@ class _ParseDioClient with dio.DioMixin implements dio.Dio { options.headers![keyHeaderApplicationId] = parseCoreData.applicationId; if (_sendSessionId && parseCoreData.sessionId != null && - options.headers![keyHeaderSessionToken] == null) + options.headers![keyHeaderSessionToken] == null) { options.headers![keyHeaderSessionToken] = parseCoreData.sessionId; + } - if (parseCoreData.clientKey != null) + if (parseCoreData.clientKey != null) { options.headers![keyHeaderClientKey] = parseCoreData.clientKey; - if (parseCoreData.masterKey != null) + } + if (parseCoreData.masterKey != null) { options.headers![keyHeaderMasterKey] = parseCoreData.masterKey; + } /// If developer wants to add custom headers, extend this class and add headers needed. if (additionalHeaders != null && additionalHeaders!.isNotEmpty) { - additionalHeaders! - .forEach((String key, String value) => options!.headers![key] = value); + additionalHeaders!.forEach( + (String key, String value) => options!.headers![key] = value); } if (parseCoreData.debug) { diff --git a/packages/dart/lib/src/network/parse_http_client.dart b/packages/dart/lib/src/network/parse_http_client.dart index 3992373d9..bc49c9581 100644 --- a/packages/dart/lib/src/network/parse_http_client.dart +++ b/packages/dart/lib/src/network/parse_http_client.dart @@ -133,13 +133,16 @@ class _ParseHTTPClient extends http.BaseClient { request.headers[keyHeaderApplicationId] = parseCoreData.applicationId; if (_sendSessionId && parseCoreData.sessionId != null && - request.headers[keyHeaderSessionToken] == null) + request.headers[keyHeaderSessionToken] == null) { request.headers[keyHeaderSessionToken] = parseCoreData.sessionId!; + } - if (parseCoreData.clientKey != null) + if (parseCoreData.clientKey != null) { request.headers[keyHeaderClientKey] = parseCoreData.clientKey!; - if (parseCoreData.masterKey != null) + } + if (parseCoreData.masterKey != null) { request.headers[keyHeaderMasterKey] = parseCoreData.masterKey!; + } /// If developer wants to add custom headers, extend this class and add headers needed. if (additionalHeaders != null && additionalHeaders!.isNotEmpty) { diff --git a/packages/dart/lib/src/network/parse_live_query.dart b/packages/dart/lib/src/network/parse_live_query.dart index 93dbba882..f30cfedf6 100644 --- a/packages/dart/lib/src/network/parse_live_query.dart +++ b/packages/dart/lib/src/network/parse_live_query.dart @@ -115,8 +115,9 @@ class LiveQueryReconnectingController { _currentTimer = null; _reconnect(); }); - if (debug) + if (debug) { print('$DEBUG_TAG: Retrytimer set to ${retryInterval[_retryState]}ms'); + } if (_retryState < retryInterval.length - 1) { _retryState++; } @@ -212,9 +213,10 @@ class LiveQueryClient { subscription._enabled = false; }); _connecting = false; - if (userInitialized) + if (userInitialized) { _clientEventStreamController.sink .add(LiveQueryClientEvent.USER_DISCONNECTED); + } } Future> subscribe( @@ -353,7 +355,7 @@ class LiveQueryClient { final String _where = query.buildQuery().replaceAll('where=', ''); //Convert where condition to Map - Map _whereMap = Map(); + Map _whereMap = {}; if (_where != '') { _whereMap = json.decode(_where); } diff --git a/packages/dart/lib/src/network/parse_query.dart b/packages/dart/lib/src/network/parse_query.dart index 057f901a6..92bc647b4 100644 --- a/packages/dart/lib/src/network/parse_query.dart +++ b/packages/dart/lib/src/network/parse_query.dart @@ -37,7 +37,7 @@ class QueryBuilder { T object; List> queries = >[]; - final Map limiters = Map(); + final Map limiters = {}; /// Adds a limit to amount of results return from Parse void setLimit(int limit) { @@ -103,10 +103,10 @@ class QueryBuilder { {bool caseSensitive = false}) { if (caseSensitive) { queries.add(MapEntry( - _SINGLE_QUERY, '\"$column\":{\"\$regex\": \"^$query\"}')); + _SINGLE_QUERY, '"$column":{"\$regex": "^$query"}')); } else { - queries.add(MapEntry(_SINGLE_QUERY, - '\"$column\":{\"\$regex\": \"^$query\", \"\$options\": \"i\"}')); + queries.add(MapEntry( + _SINGLE_QUERY, '"$column":{"\$regex": "^$query", "\$options": "i"}')); } } @@ -115,10 +115,10 @@ class QueryBuilder { {bool caseSensitive = false}) { if (caseSensitive) { queries.add(MapEntry( - _SINGLE_QUERY, '\"$column\":{\"\$regex\": \"$query\$\"}')); + _SINGLE_QUERY, '"$column":{"\$regex": "$query\$"}')); } else { queries.add(MapEntry(_SINGLE_QUERY, - '\"$column\":{\"\$regex\": \"$query\$\", \"\$options\": \"i\"}')); + '"$column":{"\$regex": "$query\$", "\$options": "i"}')); } } @@ -183,7 +183,7 @@ class QueryBuilder { /// Retrieves related objets where [String] column is a relation field to the class [String] className void whereRelatedTo(String column, String className, String objectId) { queries.add(MapEntry(_SINGLE_QUERY, - '\"\$relatedTo\":{\"object\":{\"__type\":\"Pointer\",\"className\":\"$className\",\"objectId\":\"$objectId\"},\"key\":\"$column\"}')); + '"\$relatedTo":{"object":{"__type":"Pointer","className":"$className","objectId":"$objectId"},"key":"$column"}')); } /// Returns an object where the [String] column contains select @@ -216,10 +216,10 @@ class QueryBuilder { {bool caseSensitive = false}) { if (caseSensitive) { queries.add(MapEntry( - _SINGLE_QUERY, '\"$column\":{\"\$regex\": \"$value\"}')); + _SINGLE_QUERY, '"$column":{"\$regex": "$value"}')); } else { - queries.add(MapEntry(_SINGLE_QUERY, - '\"$column\":{\"\$regex\": \"$value\", \"\$options\": \"i\"}')); + queries.add(MapEntry( + _SINGLE_QUERY, '"$column":{"\$regex": "$value", "\$options": "i"}')); } } @@ -230,7 +230,7 @@ class QueryBuilder { bool orderByScore = true, bool diacriticSensitive = false}) { queries.add(MapEntry(_SINGLE_QUERY, - '\"$column\":{\"\$text\":{\"\$search\":{\"\$term\": \"$query\", \"\$caseSensitive\": $caseSensitive , \"\$diacriticSensitive\": $diacriticSensitive }}}')); + '"$column":{"\$text":{"\$search":{"\$term": "$query", "\$caseSensitive": $caseSensitive , "\$diacriticSensitive": $diacriticSensitive }}}')); if (orderByScore) { orderByAscending('\$score'); keysToReturn(['\$score']); @@ -242,7 +242,7 @@ class QueryBuilder { final double latitude = point.latitude; final double longitude = point.longitude; queries.add(MapEntry(_SINGLE_QUERY, - '\"$column\":{\"\$nearSphere\":{\"__type\":\"GeoPoint\",\"latitude\":$latitude,\"longitude\":$longitude}}')); + '"$column":{"\$nearSphere":{"__type":"GeoPoint","latitude":$latitude,"longitude":$longitude}}')); } /// Returns an object with key point values near the point given and within the maximum distance given. @@ -252,7 +252,7 @@ class QueryBuilder { final double longitude = point.longitude; queries.add(MapEntry(_SINGLE_QUERY, - '\"$column\":{\"\$nearSphere\":{\"__type\":\"GeoPoint\",\"latitude\":$latitude,\"longitude\":$longitude},\"\$maxDistanceInMiles\":$maxDistance}')); + '"$column":{"\$nearSphere":{"__type":"GeoPoint","latitude":$latitude,"longitude":$longitude},"\$maxDistanceInMiles":$maxDistance}')); } /// Returns an object with key point values near the point given and within the maximum distance given. @@ -262,7 +262,7 @@ class QueryBuilder { final double longitude = point.longitude; queries.add(MapEntry(_SINGLE_QUERY, - '\"$column\":{\"\$nearSphere\":{\"__type\":\"GeoPoint\",\"latitude\":$latitude,\"longitude\":$longitude},\"\$maxDistanceInKilometers\":$maxDistance}')); + '"$column":{"\$nearSphere":{"__type":"GeoPoint","latitude":$latitude,"longitude":$longitude},"\$maxDistanceInKilometers":$maxDistance}')); } /// Returns an object with key point values near the point given and within the maximum distance given. @@ -272,7 +272,7 @@ class QueryBuilder { final double longitude = point.longitude; queries.add(MapEntry(_SINGLE_QUERY, - '\"$column\":{\"\$nearSphere\":{\"__type\":\"GeoPoint\",\"latitude\":$latitude,\"longitude\":$longitude},\"\$maxDistanceInRadians\":$maxDistance}')); + '"$column":{"\$nearSphere":{"__type":"GeoPoint","latitude":$latitude,"longitude":$longitude},"\$maxDistanceInRadians":$maxDistance}')); } /// Returns an object with key point values contained within a given rectangular geographic bounding box. @@ -285,20 +285,21 @@ class QueryBuilder { final double longitudeN = northeast.longitude; queries.add(MapEntry(_SINGLE_QUERY, - '\"$column\":{\"\$within\":{\"\$box\": [{\"__type\": \"GeoPoint\",\"latitude\":$latitudeS,\"longitude\":$longitudeS},{\"__type\": \"GeoPoint\",\"latitude\":$latitudeN,\"longitude\":$longitudeN}]}}')); + '"$column":{"\$within":{"\$box": [{"__type": "GeoPoint","latitude":$latitudeS,"longitude":$longitudeS},{"__type": "GeoPoint","latitude":$latitudeN,"longitude":$longitudeN}]}}')); } /// Return an object with key coordinates be contained within and on the bounds of a given polygon. /// Supports closed and open (last point is connected to first) paths /// Polygon must have at least 3 points void whereWithinPolygon(String column, List points) { - if (points.length < 3) + if (points.length < 3) { throw ArgumentError('Polygon must have at least 3 points'); + } Map dictionary = {}; dictionary['\$polygon'] = points.map((e) => e.toJson()).toList(); - queries.add(MapEntry(_SINGLE_QUERY, - '\"$column\":{\"\$geoWithin\":${jsonEncode(dictionary)}}')); + queries.add(MapEntry( + _SINGLE_QUERY, '"$column":{"\$geoWithin":${jsonEncode(dictionary)}}')); } /// Add a constraint to the query that requires a particular key's value match another QueryBuilder @@ -308,7 +309,7 @@ class QueryBuilder { query._buildQueryRelational(query.object.parseClassName); queries.add(MapEntry( - _SINGLE_QUERY, '\"$column\":{\"\$inQuery\":$inQuery}')); + _SINGLE_QUERY, '"$column":{"\$inQuery":$inQuery}')); } ///Add a constraint to the query that requires a particular key's value does not match another QueryBuilder @@ -318,7 +319,7 @@ class QueryBuilder { query._buildQueryRelational(query.object.parseClassName); queries.add(MapEntry( - _SINGLE_QUERY, '\"$column\":{\"\$notInQuery\":$inQuery}')); + _SINGLE_QUERY, '"$column":{"\$notInQuery":$inQuery}')); } /// 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. @@ -338,7 +339,7 @@ class QueryBuilder { query._buildQueryRelationalKey(query.object.parseClassName, keyInQuery); queries.add(MapEntry( - _SINGLE_QUERY, '\"$column\":{\"\$select\":$inQuery}')); + _SINGLE_QUERY, '"$column":{"\$select":$inQuery}')); } /// 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 @@ -358,24 +359,24 @@ class QueryBuilder { query._buildQueryRelationalKey(query.object.parseClassName, keyInQuery); queries.add(MapEntry( - _SINGLE_QUERY, '\"$column\":{\"\$dontSelect\":$inQuery}')); + _SINGLE_QUERY, '"$column":{"\$dontSelect":$inQuery}')); } /// Finishes the query and calls the server /// /// Make sure to call this after defining your queries - Future query( + Future query( {ProgressCallback? progressCallback}) async { - return object.query( + return object.query( buildQuery(), progressCallback: progressCallback, ); } - Future distinct( + Future distinct( String className) async { final String queryString = 'distinct=$className'; - return object.distinct(queryString); + return object.distinct(queryString); } ///Counts the number of objects that match this query @@ -392,13 +393,13 @@ class QueryBuilder { /// Builds the query relational for Parse String _buildQueryRelational(String className) { queries = _checkForMultipleColumnInstances(queries); - return '{\"where\":{${buildQueries(queries)}},\"className\":\"$className\"${getLimitersRelational(limiters)}}'; + return '{"where":{${buildQueries(queries)}},"className":"$className"${getLimitersRelational(limiters)}}'; } /// Builds the query relational with Key for Parse String _buildQueryRelationalKey(String className, String keyInQuery) { queries = _checkForMultipleColumnInstances(queries); - return '{\"query\":{\"className\":\"$className\",\"where\":{${buildQueries(queries)}}},\"key\":\"$keyInQuery\"}'; + return '{"query":{"className":"$className","where":{${buildQueries(queries)}}},"key":"$keyInQuery"}'; } /// Builds the query for Parse @@ -446,15 +447,14 @@ class QueryBuilder { if (queryOperator == _NO_OPERATOR_NEEDED) { return MapEntry( - _NO_OPERATOR_NEEDED, '\"$key\": ${jsonEncode(value)}'); + _NO_OPERATOR_NEEDED, '"$key": ${jsonEncode(value)}'); } else { - String queryString = '\"$key\":'; - final Map queryOperatorAndValueMap = - Map(); + String queryString = '"$key":'; + final Map queryOperatorAndValueMap = {}; queryOperatorAndValueMap[queryOperator] = parseEncode(value); final String formattedQueryOperatorAndValue = jsonEncode(queryOperatorAndValueMap); - queryString += '$formattedQueryOperatorAndValue'; + queryString += formattedQueryOperatorAndValue; return MapEntry(key, queryString); } } @@ -488,7 +488,7 @@ class QueryBuilder { .toList(); // Build first part of query - String queryStart = '\"${query.key}\":'; + String queryStart = '"${query.key}":'; String queryEnd = ''; // Compact all the queries in the correct format @@ -526,9 +526,9 @@ class QueryBuilder { String result = ''; map.forEach((String key, dynamic value) { if (result.isNotEmpty) { - result = result + ',\"$key":$value'; + result = result + ',"$key":$value'; } else { - result = '\"$key\":$value'; + result = '"$key":$value'; } }); return result; diff --git a/packages/dart/lib/src/objects/parse_base.dart b/packages/dart/lib/src/objects/parse_base.dart index 6521729d1..1edc5908c 100644 --- a/packages/dart/lib/src/objects/parse_base.dart +++ b/packages/dart/lib/src/objects/parse_base.dart @@ -3,11 +3,11 @@ part of flutter_parse_sdk; abstract class ParseBase { String parseClassName = 'ParseBase'; final bool _dirty = false; // reserved property - final Map _unsavedChanges = Map(); - final Map _savingChanges = Map(); + final Map _unsavedChanges = {}; + final Map _savingChanges = {}; /// Stores all the values of a class - Map _objectData = Map(); + Map _objectData = {}; /// Returns [String] objectId String? get objectId => get(keyVarObjectId); @@ -27,7 +27,7 @@ abstract class ParseBase { } if (considerChildren) { - return _areChildrenDirty(Set()); + return _areChildrenDirty({}); } return false; } diff --git a/packages/dart/lib/src/objects/parse_config.dart b/packages/dart/lib/src/objects/parse_config.dart index 1e0d85640..8df935d63 100644 --- a/packages/dart/lib/src/objects/parse_config.dart +++ b/packages/dart/lib/src/objects/parse_config.dart @@ -30,7 +30,7 @@ class ParseConfig extends ParseObject { try { final String uri = '${ParseCoreData().serverUrl}/config'; final String body = - '{\"params\":{\"$key\": ${json.encode(parseEncode(value))}}}'; + '{"params":{"$key": ${json.encode(parseEncode(value))}}}'; final ParseNetworkResponse result = await _client.put(uri, data: body); return handleResponse( this, result, ParseApiRQ.addConfig, _debug, parseClassName); diff --git a/packages/dart/lib/src/objects/parse_error.dart b/packages/dart/lib/src/objects/parse_error.dart index d450ba737..a13b32c5d 100644 --- a/packages/dart/lib/src/objects/parse_error.dart +++ b/packages/dart/lib/src/objects/parse_error.dart @@ -13,7 +13,7 @@ class ParseError { } } - Map _exceptions = { + static const Map _exceptions = { -1: 'UnknownError', // SDK errors / Errors diff --git a/packages/dart/lib/src/objects/parse_file.dart b/packages/dart/lib/src/objects/parse_file.dart index 214c7135f..5e9086d19 100644 --- a/packages/dart/lib/src/objects/parse_file.dart +++ b/packages/dart/lib/src/objects/parse_file.dart @@ -74,7 +74,7 @@ class ParseFile extends ParseFileBase { HttpHeaders.contentLengthHeader: '${file!.lengthSync()}', }; try { - final String uri = ParseCoreData().serverUrl + '$_path'; + final String uri = ParseCoreData().serverUrl + _path; final ParseNetworkResponse response = await _client.postBytes( uri, options: ParseNetworkOptions(headers: headers), diff --git a/packages/dart/lib/src/objects/parse_file_base.dart b/packages/dart/lib/src/objects/parse_file_base.dart index 6eecec459..c5c1f903c 100644 --- a/packages/dart/lib/src/objects/parse_file_base.dart +++ b/packages/dart/lib/src/objects/parse_file_base.dart @@ -16,9 +16,7 @@ abstract class ParseFileBase extends ParseObject { client: client) { _path = '/files/$name'; this.name = name; - if(url != null) - this.url = url; - + if (url != null) this.url = url; } String get name => super.get(keyVarName)!; diff --git a/packages/dart/lib/src/objects/parse_file_web.dart b/packages/dart/lib/src/objects/parse_file_web.dart index 3a6a57398..2b1f050e1 100644 --- a/packages/dart/lib/src/objects/parse_file_web.dart +++ b/packages/dart/lib/src/objects/parse_file_web.dart @@ -53,7 +53,7 @@ class ParseWebFile extends ParseFileBase { mime(url ?? name) ?? 'application/octet-stream', }; try { - final String uri = ParseCoreData().serverUrl + '$_path'; + final String uri = ParseCoreData().serverUrl + _path; final ParseNetworkResponse response = await _client.postBytes( uri, options: ParseNetworkOptions(headers: headers), diff --git a/packages/dart/lib/src/objects/parse_object.dart b/packages/dart/lib/src/objects/parse_object.dart index 12b4f9985..3a2ee5728 100644 --- a/packages/dart/lib/src/objects/parse_object.dart +++ b/packages/dart/lib/src/objects/parse_object.dart @@ -49,7 +49,7 @@ class ParseObject extends ParseBase implements ParseCloneable { /// Gets all objects from this table - Limited response at the moment Future getAll() async { try { - final Uri url = getSanitisedUri(_client, '$_path'); + final Uri url = getSanitisedUri(_client, _path); final ParseNetworkResponse result = await _client.get(url.toString()); return handleResponse( this, result, ParseApiRQ.getAll, _debug, parseClassName); @@ -61,7 +61,7 @@ class ParseObject extends ParseBase implements ParseCloneable { /// Creates a new object and saves it online Future create({bool allowCustomObjectId = false}) async { try { - final Uri url = getSanitisedUri(_client, '$_path'); + final Uri url = getSanitisedUri(_client, _path); final String body = json.encode(toJson( forApiRQ: true, allowCustomObjectId: allowCustomObjectId, @@ -118,10 +118,10 @@ class ParseObject extends ParseBase implements ParseCloneable { } Future _saveChildren(dynamic object) async { - final Set uniqueObjects = Set(); - final Set uniqueFiles = Set(); - if (!_collectionDirtyChildren(object, uniqueObjects, uniqueFiles, - Set(), Set())) { + final Set uniqueObjects = {}; + final Set uniqueFiles = {}; + if (!_collectionDirtyChildren( + object, uniqueObjects, uniqueFiles, {}, {})) { final ParseResponse response = ParseResponse(); return response; } @@ -279,7 +279,7 @@ class ParseObject extends ParseBase implements ParseCloneable { /* Check for cycles of new objects. Any such cycle means it will be impossible to save this collection of objects, so throw an exception. */ if (object.objectId != null) { - seenNew = Set(); + seenNew = {}; } else { if (seenNew.contains(object)) { // TODO(yulingtianxia): throw an error? @@ -385,7 +385,7 @@ class ParseObject extends ParseBase implements ParseCloneable { try { if (objectId != null) { final Uri url = getSanitisedUri(_client, '$_path/$objectId'); - final String body = '{\"$key\":{\"__op\":\"Delete\"}}'; + final String body = '{"$key":{"__op":"Delete"}}'; final ParseNetworkResponse result = await _client.put(url.toString(), data: body); final ParseResponse response = handleResponse( @@ -411,7 +411,7 @@ class ParseObject extends ParseBase implements ParseCloneable { Future query(String query, {ProgressCallback? progressCallback}) async { try { - final Uri url = getSanitisedUri(_client, '$_path', query: query); + final Uri url = getSanitisedUri(_client, _path, query: query); final ParseNetworkResponse result = await _client.get( url.toString(), onReceiveProgress: progressCallback, @@ -425,7 +425,7 @@ class ParseObject extends ParseBase implements ParseCloneable { Future distinct(String query) async { try { - final Uri url = getSanitisedUri(_client, '$_aggregatepath', query: query); + final Uri url = getSanitisedUri(_client, _aggregatepath, query: query); final ParseNetworkResponse result = await _client.get(url.toString()); return handleResponse( this, result, ParseApiRQ.query, _debug, parseClassName); @@ -456,7 +456,7 @@ class ParseObject extends ParseBase implements ParseCloneable { throw 'can not fetch without a objectId'; } - final ParseResponse response = await this.getObject(this.objectId!); + final ParseResponse response = await getObject(objectId!); if (response.success && response.results != null) { return response.results!.first; diff --git a/packages/dart/lib/src/objects/parse_relation.dart b/packages/dart/lib/src/objects/parse_relation.dart index 7509b2c5a..678414821 100644 --- a/packages/dart/lib/src/objects/parse_relation.dart +++ b/packages/dart/lib/src/objects/parse_relation.dart @@ -26,7 +26,7 @@ class ParseRelation { //The key of the relation in the parent object. String _key = ''; //For offline caching, we keep track of every object we've known to be in the relation. - Set? _knownObjects = Set(); + Set? _knownObjects = {}; QueryBuilder getQuery() { return QueryBuilder(ParseCoreData.instance.createObject(_targetClass!)) diff --git a/packages/dart/lib/src/objects/parse_user.dart b/packages/dart/lib/src/objects/parse_user.dart index 5e75df787..e4c15bfc6 100644 --- a/packages/dart/lib/src/objects/parse_user.dart +++ b/packages/dart/lib/src/objects/parse_user.dart @@ -130,7 +130,7 @@ class ParseUser extends ParseObject implements ParseCloneable { } try { - final Uri url = getSanitisedUri(_client, '$keyEndPointUserName'); + final Uri url = getSanitisedUri(_client, keyEndPointUserName); final ParseNetworkResponse response = await _client.get( url.toString(), options: ParseNetworkOptions(headers: headers), @@ -185,7 +185,7 @@ class ParseUser extends ParseObject implements ParseCloneable { } } - final Uri url = getSanitisedUri(_client, '$path'); + final Uri url = getSanitisedUri(_client, path); final String body = json.encode(toJson(forApiRQ: true)); _saveChanges(); final String? installationId = await _getInstallationId(); @@ -219,7 +219,7 @@ class ParseUser extends ParseObject implements ParseCloneable { keyVarPassword: password! }; final String? installationId = await _getInstallationId(); - final Uri url = getSanitisedUri(_client, '$keyEndPointLogin'); + final Uri url = getSanitisedUri(_client, keyEndPointLogin); _saveChanges(); final ParseNetworkResponse response = await _client.post( url.toString(), @@ -245,7 +245,7 @@ class ParseUser extends ParseObject implements ParseCloneable { {bool doNotSendInstallationID = false}) async { forgetLocalSession(); try { - final Uri url = getSanitisedUri(_client, '$keyEndPointUsers'); + final Uri url = getSanitisedUri(_client, keyEndPointUsers); const Uuid uuid = Uuid(); final String? installationId = await _getInstallationId(); @@ -290,7 +290,7 @@ class ParseUser extends ParseObject implements ParseCloneable { Future _loginWith(String provider, Object authData, {bool doNotSendInstallationID = false}) async { try { - final Uri url = getSanitisedUri(_client, '$keyEndPointUsers'); + final Uri url = getSanitisedUri(_client, keyEndPointUsers); final String? installationId = await _getInstallationId(); final Map body = toJson(forApiRQ: true); body['authData'] = {provider: authData}; @@ -333,7 +333,7 @@ class ParseUser extends ParseObject implements ParseCloneable { } try { - final Uri url = getSanitisedUri(_client, '$keyEndPointLogout'); + final Uri url = getSanitisedUri(_client, keyEndPointLogout); final ParseNetworkResponse response = await _client.post( url.toString(), options: ParseNetworkOptions( @@ -449,7 +449,7 @@ class ParseUser extends ParseObject implements ParseCloneable { securityContext: ParseCoreData().securityContext); try { - final Uri url = getSanitisedUri(_client, '$path'); + final Uri url = getSanitisedUri(_client, path); final ParseNetworkResponse response = await _client.get(url.toString()); final ParseResponse parseResponse = handleResponse( emptyUser, response, ParseApiRQ.getAll, _debug, keyClassUser); diff --git a/packages/dart/lib/src/objects/response/parse_exception_response.dart b/packages/dart/lib/src/objects/response/parse_exception_response.dart index f2e6faf19..aea23d599 100644 --- a/packages/dart/lib/src/objects/response/parse_exception_response.dart +++ b/packages/dart/lib/src/objects/response/parse_exception_response.dart @@ -24,5 +24,4 @@ ParseResponse buildParseResponseWithException(Exception exception) { return ParseResponse( error: ParseError(message: exception.toString(), exception: exception)); - ; } diff --git a/packages/dart/lib/src/objects/response/parse_response_builder.dart b/packages/dart/lib/src/objects/response/parse_response_builder.dart index dec3e91b9..d36d8dd98 100644 --- a/packages/dart/lib/src/objects/response/parse_response_builder.dart +++ b/packages/dart/lib/src/objects/response/parse_response_builder.dart @@ -79,11 +79,11 @@ class _ParseResponseBuilder { } } } - } else if (result is Map) { - final Map map = result as Map; + } else if (result is Map) { + final Map map = result; if (object is Parse) { response.result = map; - } else if (map != null && map.length == 1 && map.containsKey('results')) { + } else if (map.length == 1 && map.containsKey('results')) { final List results = map['results']; if (results[0] is String) { response.results = results; @@ -95,7 +95,7 @@ class _ParseResponseBuilder { response.result = items; response.count = items.length; } - } else if (map != null && map.length == 2 && map.containsKey('count')) { + } else if (map.length == 2 && map.containsKey('count')) { final List results = [map['count']]; response.results = results; response.result = results; @@ -127,7 +127,7 @@ class _ParseResponseBuilder { return object.clone(map); } else if (object is ParseObject) { // Merge unsaved changes and response. - final Map unsaved = Map(); + final Map unsaved = {}; unsaved.addAll(object._unsavedChanges); unsaved.forEach((String k, dynamic v) { if (map[k] != null && map[k] != v) { @@ -145,6 +145,6 @@ class _ParseResponseBuilder { } bool isHealthCheck(ParseNetworkResponse apiResponse) { - return ['{\"status\":\"ok\"}', 'OK'].contains(apiResponse.data); + return ['{"status":"ok"}', 'OK'].contains(apiResponse.data); } } diff --git a/packages/dart/lib/src/utils/parse_decoder.dart b/packages/dart/lib/src/utils/parse_decoder.dart index b3f14c1a6..331f1173a 100644 --- a/packages/dart/lib/src/utils/parse_decoder.dart +++ b/packages/dart/lib/src/utils/parse_decoder.dart @@ -9,7 +9,7 @@ List _convertJSONArrayToList(List array) { } Map _convertJSONObjectToMap(Map object) { - final Map map = Map(); + final Map map = {}; object.forEach((String key, dynamic value) { map.putIfAbsent(key, () => parseDecode(value)); }); @@ -38,7 +38,7 @@ dynamic parseDecode(dynamic value) { return value; } - if (!(value is Map)) { + if (value is! Map) { return value; } diff --git a/packages/dart/lib/src/utils/parse_live_list.dart b/packages/dart/lib/src/utils/parse_live_list.dart index 8b91d4639..7e2c102b9 100644 --- a/packages/dart/lib/src/utils/parse_live_list.dart +++ b/packages/dart/lib/src/utils/parse_live_list.dart @@ -130,11 +130,12 @@ class ParseLiveList { Future _runQuery() async { final QueryBuilder query = QueryBuilder.copy(_query); - if (_debug) + if (_debug) { print('ParseLiveList: lazyLoading is ${_lazyLoading ? 'on' : 'off'}'); + } if (_lazyLoading) { final List keys = _preloadedColumns.toList(); - if (_lazyLoading && query.limiters.containsKey('order')) + if (_lazyLoading && query.limiters.containsKey('order')) { keys.addAll( query.limiters['order'].toString().split(',').map((String string) { if (string.startsWith('-')) { @@ -143,7 +144,9 @@ class ParseLiveList { return string; }), ); - if (keys.isNotEmpty) query.keysToReturn(keys); + if (keys.isNotEmpty) { + query.keysToReturn(keys); + } } return await query.query(); } @@ -557,7 +560,7 @@ class ParseLiveListElement { {bool loaded = false, Map? updatedSubItems}) : _loaded = loaded { _updatedSubItems = - _toSubscriptionMap(updatedSubItems ?? Map()); + _toSubscriptionMap(updatedSubItems ?? {}); if (_updatedSubItems.isNotEmpty) { _liveQuery = LiveQuery(); _subscribe(); @@ -576,7 +579,7 @@ class ParseLiveListElement { T get object => _object.clone(_object.toJson(full: true)); Map _toSubscriptionMap(Map map) { - final Map result = Map(); + final Map result = {}; for (String key in map.keys) { result.putIfAbsent(PathKey(key), () => _toSubscriptionMap(map[key])); } @@ -584,7 +587,7 @@ class ParseLiveListElement { } Map _toKeyMap(Map map) { - final Map result = Map(); + final Map result = {}; for (PathKey key in map.keys) { result.putIfAbsent(key.key, () => _toKeyMap(map[key])); } diff --git a/packages/dart/pubspec.yaml b/packages/dart/pubspec.yaml index 26dc03005..f1935b95d 100644 --- a/packages/dart/pubspec.yaml +++ b/packages/dart/pubspec.yaml @@ -4,7 +4,7 @@ version: 3.2.0 homepage: https://github.com/parse-community/Parse-SDK-Flutter environment: - sdk: '>=2.12.0 <3.0.0' + sdk: ">=2.12.0 <3.0.0" dependencies: # Networking @@ -27,6 +27,7 @@ dependency_overrides: path: ^1.8.1 # required for transitive use only dev_dependencies: + lints: ^1.0.1 # Testing build_runner: ^2.1.10 mockito: ^5.1.0 diff --git a/packages/flutter/CHANGELOG.md b/packages/flutter/CHANGELOG.md index 88e45d8f2..9faf40d91 100644 --- a/packages/flutter/CHANGELOG.md +++ b/packages/flutter/CHANGELOG.md @@ -1,36 +1,51 @@ -## 3.2.0 -Bug fixes: - * #717 - Old version of connectivity_plus package - * #714 - package_info_plus not work in web - * #712 - MissingPluginException (No implementation found for method getAll) - * #696 - ParseRelation#query - Unhandled Exception: type 'ParseObject' is not a subtype of type - * #679 - Error in progressCallback - * #661 - first: Correct return type - * #653 - ParseLiveListWidget MongoError -Updated dependencies versions -Documentation update - -## 3.1.0 -Bug fixes -General improvements -Updated dependencies - -## 3.0.0 -Stable null safety release. - -## 2.1.0 -Option para uses ParseHTTPClient (default) or ParseDioClient (slow on Flutter Web). - **BREAKING CHANGE** if use progress callback at the file upload in version 2.0.1 -Added method excludeKeys: Exclude specific fields from the returned query -Changed to the method POST on Login -Bug fixes -General improvements -Updated dependencies -## 2.0.1 -Fixed network exceptions. [#482](https://github.com/parse-community/Parse-SDK-Flutter/pull/482) - -## 2.0.0 -First release. - -## 1.0.28 -Renamed to 2.0.0 +## [3.1.2](https://github.com/parse-community/Parse-SDK-Flutter/compare/flutter-3.1.1...flutter-3.1.2) (2022-05-30) + +### Refactors + +* fix analyzer code style warnings ([#733](https://github.com/parse-community/Parse-SDK-Flutter/issues/733)) + +## [3.1.1](https://github.com/parse-community/Parse-SDK-Flutter/compare/V3.1.0...flutter-3.1.1) (2022-05-29) + +### Bug Fixes + +* update example app to use Android embedding v2 ([#722](https://github.com/parse-community/Parse-SDK-Flutter/issues/722)) ([e092189](https://github.com/parse-community/Parse-SDK-Flutter/commit/e092189cb666c25b3e2c9dbbf95316e9cfa88e72)) + +# [3.1.0](https://github.com/parse-community/Parse-SDK-Flutter/compare/V3.0.0...V3.1.0) (2021-06-28) + +### Bug Fixes + +* General improvements +* Updated dependencies + +# [3.0.0](https://github.com/parse-community/Parse-SDK-Flutter/compare/2.1.0...V3.0.0) (2021-04-14) + +### Bug Fixes + +* Stable null safety release + +# [2.1.0](https://github.com/parse-community/Parse-SDK-Flutter/compare/2.0.1...2.1.0) (2021-02-18) + +### BREAKING CHANGES + +* Changed to HTTP method POST for login +* Change in progress callback for file upload + +### Features + +* Option to use `ParseHTTPClient` (default) or `ParseDioClient` (slow on Flutter Web) +* Added method excludeKeys to exclude specific fields from the returned query + +### Bug Fixes + +* General improvements +* Updated dependencies + +## [2.0.1](https://github.com/parse-community/Parse-SDK-Flutter/compare/2.0.0...2.0.1) (2020-10-24) + +### Bug Fixes + +* Fixed network exceptions ([#482](https://github.com/parse-community/Parse-SDK-Flutter/pull/482)) + +## [2.0.0](https://github.com/parse-community/Parse-SDK-Flutter/compare/1.0.28...2.0.0) (2020-10-13) + +First official release. From this release onwards the previous repository has been separated into a pure dart (parse_server_sdk) and a flutter package (parse_server_sdk_flutter). This was done in order to provide a dart package for the parse-server, while keeping maintenance simple. You can find both packages in the package directory. diff --git a/packages/flutter/README.md b/packages/flutter/README.md index a3761c1e2..1830736c4 100644 --- a/packages/flutter/README.md +++ b/packages/flutter/README.md @@ -1,17 +1,45 @@ -

- Parse Logo - Flutter Logo -

+![parse-repository-header-sdk-flutter](https://user-images.githubusercontent.com/5673677/166121333-2a144ce3-95bc-45d6-8840-d5b2885f2046.png) --- -## Parse For Flutter! -Hi, this is a Flutter plugin that allows communication with a Parse Server, (https://parseplatform.org) either hosted on your own server or another, like (http://Back4App.com). +This library gives you access to the powerful Parse Server backend from your Flutter app. For more information on Parse Platform and its features, visit [parseplatform.org](https://parseplatform.org). -This is a work in progress and we are consistently updating it. Please let us know if you think anything needs changing/adding, and more than ever, please do join in on this project. (Even if it is just to improve our documentation) +--- + +- [Getting Started](#getting-started) + - [Web support](#web-support) + - [Network client](#network-client) +- [Objects](#objects) +- [Custom Objects](#custom-objects) +- [Add new values to objects](#add-new-values-to-objects) +- [Save objects using pins](#save-objects-using-pins) +- [Storage](#storage) +- [Increment Counter Values](#increment-counter-values) +- [Array Operator](#array-operator) +- [Queries](#queries) + - [Alternative Query Methods](#alternative-query-methods) +- [Complex Queries](#complex-queries) +- [Relational queries](#relational-queries) +- [Counting Objects](#counting-objects) +- [Live Queries](#live-queries) +- [ParseLiveList](#parselivelist) + - [General Use](#general-use) + - [Include Sub-Objects](#include-sub-objects) + - [Lazy Loading](#lazy-loading) +- [Users](#users) +- [Facebook, OAuth and 3rd Party Login/User](#facebook-oauth-and-3rd-party-loginuser) +- [Security for Objects - ParseACL](#security-for-objects---parseacl) +- [Config](#config) +- [Cloud Functions](#cloud-functions) +- [Relation](#relation) +- [File](#file) +- [Other Features](#other-features) + +--- ## Getting Started -To install, either add [dependency in your pubspec.yaml file](https://pub.dev/packages/parse_server_sdk_flutter/install). + +To install add the dependency to your [pubspec.yaml](https://pub.dev/packages/parse_server_sdk_flutter/install) file. Once you have the library added to your project, upon first call to your app (Similar to what your application class would be) add the following... @@ -200,7 +228,8 @@ The storage method is defined in the parameter __coreStore__ in Parse().initial Check sample code for options -## Increment Counter values in objects +## Increment Counter Values + Retrieve it, call ```dart @@ -216,7 +245,8 @@ var response = dietPlan.save() ``` -## Array Operator in objects +## Array Operator + Retrieve it, call ```dart @@ -272,7 +302,7 @@ if (response.success) { } ``` -### Alternative query methods +### Alternative Query Methods The standard query method `query()` returns a `ParseResponse` that contains the result or the error. As an alternative, you can also use `Future> find()` for receiving options. This method returns an `Future` that either resolves in an error (equivalent of the error in the `ParseResponse`) or an `List` containing the queried objects. One difference, you should be aware of, is the fact, that `Future> find()` will return an empty list instead of the 'No results' error you receive in case no object matches you query. @@ -281,7 +311,8 @@ Choosing between `query()` and `find()` comes down to personal preference. Both Similar to `find()` the `QueryBuilder` also has a function called `Future first()`. Just like `find()` `first()` is just a convenience method that makes querying the first object satisfying the query simpler. `first()` returns an `Future`, that resoles in an error or the first object matching the query. In case no object satisfies the query, the result will be `null`. -## Complex queries +## Complex Queries + You can create complex queries to really put your database to the test: ```dart @@ -631,7 +662,8 @@ ParseLiveListWidget( duration: Duration(seconds: 1), ); ``` -### included Sub-Objects +### Include Sub-Objects + By default, ParseLiveQuery will provide you with all the objects you included in your Query like this: ```dart queryBuilder.includeObject(/*List of all the included sub-objects*/); @@ -641,7 +673,8 @@ To activate listening for updates on all included objects, add `listenOnAllSubIt If you want ParseLiveList to listen for updates on only some sub-objects, use `listeningIncludes: const [/*all the included sub-objects*/]` instead. Just as QueryBuilder, ParseLiveList supports nested sub-objects too. -### Lazy loading +### Lazy Loading + By default, ParseLiveList lazy loads the content. You can avoid that by setting `lazyLoading: false`. In case you want to use lazyLoading but you need some columns to be preloaded, you can provide a list of `preloadedColumns`. @@ -944,7 +977,8 @@ someParseObject.set("image", parseFile); await someParseObject.save(); ``` -## Other Features of this library +## Other Features + Main: * Installation (View the example application) * GeoPoints (View the example application) @@ -959,8 +993,5 @@ User: Objects: * Create new object -* Extend Parse Object and create local objects that can be saved and retreived +* Extend Parse Object and create local objects that can be saved and retrieved * Queries - -## Author:- -This project was authored by Phill Wiggins. You can contact me at phill.wiggins@gmail.com diff --git a/packages/flutter/analysis_options.yaml b/packages/flutter/analysis_options.yaml new file mode 100644 index 000000000..fd16f9219 --- /dev/null +++ b/packages/flutter/analysis_options.yaml @@ -0,0 +1,28 @@ +# This file configures the analyzer, which statically analyzes Dart code to +# check for errors, warnings, and lints. +# +# The issues identified by the analyzer are surfaced in the UI of Dart-enabled +# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be +# invoked from the command line by running `flutter analyze`. + +# The following line activates a set of recommended lints for Flutter apps, +# packages, and plugins designed to encourage good coding practices. +include: package:flutter_lints/flutter.yaml + +linter: + # The lint rules applied to this project can be customized in the + # section below to disable rules from the `package:flutter_lints/flutter.yaml` + # included above or to enable additional rules. A list of all available lints + # and their documentation is published at + # https://dart-lang.github.io/linter/lints/index.html. + # + # Instead of disabling a lint rule for the entire project in the + # section below, it can also be suppressed for a single line of code + # or a specific dart file by using the `// ignore: name_of_lint` and + # `// ignore_for_file: name_of_lint` syntax on the line or in the file + # producing the lint. + rules: + # avoid_print: false # Uncomment to disable the `avoid_print` rule + # prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule +# Additional information about this file can be found at +# https://dart.dev/guides/language/analysis-options diff --git a/packages/flutter/example/android/.gitignore b/packages/flutter/example/android/.gitignore index 65b7315af..6f568019d 100644 --- a/packages/flutter/example/android/.gitignore +++ b/packages/flutter/example/android/.gitignore @@ -1,10 +1,13 @@ -*.iml -*.class -.gradle +gradle-wrapper.jar +/.gradle +/captures/ +/gradlew +/gradlew.bat /local.properties -/.idea/workspace.xml -/.idea/libraries -.DS_Store -/build -/captures GeneratedPluginRegistrant.java + +# Remember to never publicly share your keystore. +# See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app +key.properties +**/*.keystore +**/*.jks diff --git a/packages/flutter/example/android/app/build.gradle b/packages/flutter/example/android/app/build.gradle index 062011fe4..cfbcd4895 100644 --- a/packages/flutter/example/android/app/build.gradle +++ b/packages/flutter/example/android/app/build.gradle @@ -11,24 +11,35 @@ if (flutterRoot == null) { throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") } +def flutterVersionCode = localProperties.getProperty('flutter.versionCode') +if (flutterVersionCode == null) { + flutterVersionCode = '1' +} + +def flutterVersionName = localProperties.getProperty('flutter.versionName') +if (flutterVersionName == null) { + flutterVersionName = '1.0' +} + apply plugin: 'com.android.application' +apply plugin: 'kotlin-android' apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" android { - compileSdkVersion 28 + compileSdkVersion flutter.compileSdkVersion - lintOptions { - disable 'InvalidPackage' + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 } defaultConfig { // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). applicationId "com.example.flutterpluginexample" - minSdkVersion 16 - targetSdkVersion 28 - versionCode 1 - versionName "1.0" - testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" + minSdkVersion flutter.minSdkVersion + targetSdkVersion flutter.targetSdkVersion + versionCode flutterVersionCode.toInteger() + versionName flutterVersionName } buildTypes { @@ -43,9 +54,3 @@ android { flutter { source '../..' } - -dependencies { - testImplementation 'junit:junit:4.12' - androidTestImplementation 'com.android.support.test:runner:1.0.2' - androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2' -} diff --git a/packages/flutter/example/android/app/src/debug/AndroidManifest.xml b/packages/flutter/example/android/app/src/debug/AndroidManifest.xml new file mode 100644 index 000000000..7dc721db1 --- /dev/null +++ b/packages/flutter/example/android/app/src/debug/AndroidManifest.xml @@ -0,0 +1,7 @@ + + + + diff --git a/packages/flutter/example/android/app/src/main/AndroidManifest.xml b/packages/flutter/example/android/app/src/main/AndroidManifest.xml index 9fbcae13f..41861efad 100644 --- a/packages/flutter/example/android/app/src/main/AndroidManifest.xml +++ b/packages/flutter/example/android/app/src/main/AndroidManifest.xml @@ -1,39 +1,41 @@ - - + - - + + android:name="io.flutter.embedding.android.NormalTheme" + android:resource="@style/NormalTheme" /> - - + + + + - + \ No newline at end of file diff --git a/packages/flutter/example/android/app/src/main/gen/com/example/flutterpluginexample/BuildConfig.java b/packages/flutter/example/android/app/src/main/gen/com/example/flutterpluginexample/BuildConfig.java deleted file mode 100644 index 1888c7a11..000000000 --- a/packages/flutter/example/android/app/src/main/gen/com/example/flutterpluginexample/BuildConfig.java +++ /dev/null @@ -1,8 +0,0 @@ -/*___Generated_by_IDEA___*/ - -package com.example.flutterpluginexample; - -/* This stub is only used by the IDE. It is NOT the BuildConfig class actually packed into the APK */ -public final class BuildConfig { - public final static boolean DEBUG = Boolean.parseBoolean(null); -} \ No newline at end of file diff --git a/packages/flutter/example/android/app/src/main/gen/com/example/flutterpluginexample/Manifest.java b/packages/flutter/example/android/app/src/main/gen/com/example/flutterpluginexample/Manifest.java deleted file mode 100644 index 22770c8f6..000000000 --- a/packages/flutter/example/android/app/src/main/gen/com/example/flutterpluginexample/Manifest.java +++ /dev/null @@ -1,7 +0,0 @@ -/*___Generated_by_IDEA___*/ - -package com.example.flutterpluginexample; - -/* This stub is only used by the IDE. It is NOT the Manifest class actually packed into the APK */ -public final class Manifest { -} \ No newline at end of file diff --git a/packages/flutter/example/android/app/src/main/gen/com/example/flutterpluginexample/R.java b/packages/flutter/example/android/app/src/main/gen/com/example/flutterpluginexample/R.java deleted file mode 100644 index 7329f17da..000000000 --- a/packages/flutter/example/android/app/src/main/gen/com/example/flutterpluginexample/R.java +++ /dev/null @@ -1,7 +0,0 @@ -/*___Generated_by_IDEA___*/ - -package com.example.flutterpluginexample; - -/* This stub is only used by the IDE. It is NOT the R class actually packed into the APK */ -public final class R { -} \ No newline at end of file diff --git a/packages/flutter/example/android/app/src/main/java/com/example/flutterpluginexample/MainActivity.java b/packages/flutter/example/android/app/src/main/java/com/example/flutterpluginexample/MainActivity.java index c8222753f..b1cfcdb2d 100644 --- a/packages/flutter/example/android/app/src/main/java/com/example/flutterpluginexample/MainActivity.java +++ b/packages/flutter/example/android/app/src/main/java/com/example/flutterpluginexample/MainActivity.java @@ -1,13 +1,6 @@ package com.example.flutterpluginexample; -import android.os.Bundle; -import io.flutter.app.FlutterActivity; -import io.flutter.plugins.GeneratedPluginRegistrant; +import io.flutter.embedding.android.FlutterActivity; public class MainActivity extends FlutterActivity { - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - GeneratedPluginRegistrant.registerWith(this); - } } diff --git a/packages/flutter/example/android/app/src/main/res/drawable-v21/launch_background.xml b/packages/flutter/example/android/app/src/main/res/drawable-v21/launch_background.xml new file mode 100644 index 000000000..f74085f3f --- /dev/null +++ b/packages/flutter/example/android/app/src/main/res/drawable-v21/launch_background.xml @@ -0,0 +1,12 @@ + + + + + + + + diff --git a/packages/flutter/example/android/app/src/main/res/values-night/styles.xml b/packages/flutter/example/android/app/src/main/res/values-night/styles.xml new file mode 100644 index 000000000..3db14bb53 --- /dev/null +++ b/packages/flutter/example/android/app/src/main/res/values-night/styles.xml @@ -0,0 +1,18 @@ + + + + + + + diff --git a/packages/flutter/example/android/app/src/main/res/values/styles.xml b/packages/flutter/example/android/app/src/main/res/values/styles.xml index 00fa4417c..d460d1e92 100644 --- a/packages/flutter/example/android/app/src/main/res/values/styles.xml +++ b/packages/flutter/example/android/app/src/main/res/values/styles.xml @@ -1,8 +1,18 @@ - + + diff --git a/packages/flutter/example/android/app/src/profile/AndroidManifest.xml b/packages/flutter/example/android/app/src/profile/AndroidManifest.xml new file mode 100644 index 000000000..7dc721db1 --- /dev/null +++ b/packages/flutter/example/android/app/src/profile/AndroidManifest.xml @@ -0,0 +1,7 @@ + + + + diff --git a/packages/flutter/example/android/build.gradle b/packages/flutter/example/android/build.gradle index 6de372893..4256f9173 100644 --- a/packages/flutter/example/android/build.gradle +++ b/packages/flutter/example/android/build.gradle @@ -1,18 +1,20 @@ buildscript { + ext.kotlin_version = '1.6.10' repositories { google() - jcenter() + mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:3.5.3' + classpath 'com.android.tools.build:gradle:4.1.0' + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" } } allprojects { repositories { google() - jcenter() + mavenCentral() } } diff --git a/packages/flutter/example/android/gradle.properties b/packages/flutter/example/android/gradle.properties index 7be3d8b46..94adc3a3f 100644 --- a/packages/flutter/example/android/gradle.properties +++ b/packages/flutter/example/android/gradle.properties @@ -1,2 +1,3 @@ org.gradle.jvmargs=-Xmx1536M -android.enableR8=true +android.useAndroidX=true +android.enableJetifier=true diff --git a/packages/flutter/example/android/gradle/wrapper/gradle-wrapper.properties b/packages/flutter/example/android/gradle/wrapper/gradle-wrapper.properties index 63ab3ae08..bc6a58afd 100644 --- a/packages/flutter/example/android/gradle/wrapper/gradle-wrapper.properties +++ b/packages/flutter/example/android/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-all.zip diff --git a/packages/flutter/example/android/settings.gradle b/packages/flutter/example/android/settings.gradle index 5a2f14fb1..44e62bcf0 100644 --- a/packages/flutter/example/android/settings.gradle +++ b/packages/flutter/example/android/settings.gradle @@ -1,15 +1,11 @@ include ':app' -def flutterProjectRoot = rootProject.projectDir.parentFile.toPath() +def localPropertiesFile = new File(rootProject.projectDir, "local.properties") +def properties = new Properties() -def plugins = new Properties() -def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins') -if (pluginsFile.exists()) { - pluginsFile.withReader('UTF-8') { reader -> plugins.load(reader) } -} +assert localPropertiesFile.exists() +localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) } -plugins.each { name, path -> - def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile() - include ":$name" - project(":$name").projectDir = pluginDirectory -} +def flutterSdkPath = properties.getProperty("flutter.sdk") +assert flutterSdkPath != null, "flutter.sdk not set in local.properties" +apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle" diff --git a/packages/flutter/example/lib/data/repositories/diet_plan/provider_api_diet_plan.dart b/packages/flutter/example/lib/data/repositories/diet_plan/provider_api_diet_plan.dart index 41583c797..e5aed5100 100644 --- a/packages/flutter/example/lib/data/repositories/diet_plan/provider_api_diet_plan.dart +++ b/packages/flutter/example/lib/data/repositories/diet_plan/provider_api_diet_plan.dart @@ -13,7 +13,7 @@ class DietPlanProviderApi implements DietPlanProviderContract { @override Future addAll(List items) async { - final List responses = List(); + final List responses = []; for (final DietPlan item in items) { final ApiResponse response = await add(item); @@ -57,7 +57,7 @@ class DietPlanProviderApi implements DietPlanProviderContract { @override Future updateAll(List items) async { - final List responses = List(); + final List responses = []; for (final DietPlan item in items) { final ApiResponse response = await update(item); diff --git a/packages/flutter/example/lib/data/repositories/diet_plan/provider_db_diet_plan.dart b/packages/flutter/example/lib/data/repositories/diet_plan/provider_db_diet_plan.dart index 4528ead5f..97a0e412b 100644 --- a/packages/flutter/example/lib/data/repositories/diet_plan/provider_db_diet_plan.dart +++ b/packages/flutter/example/lib/data/repositories/diet_plan/provider_db_diet_plan.dart @@ -26,7 +26,7 @@ class DietPlanProviderDB implements DietPlanProviderContract { @override Future addAll(List items) async { - final List itemsInDb = List(); + final List itemsInDb = []; for (final DietPlan item in items) { final ApiResponse response = await add(item); @@ -45,9 +45,9 @@ class DietPlanProviderDB implements DietPlanProviderContract { @override Future getAll() async { - final List foodItems = List(); + final List foodItems = []; - final List sortOrders = List(); + final List sortOrders = []; sortOrders.add(SortOrder(keyName)); final Finder finder = Finder(sortOrders: sortOrders); final List>> records = @@ -82,7 +82,7 @@ class DietPlanProviderDB implements DietPlanProviderContract { @override Future getNewerThan(DateTime date) async { - final List foodItems = List(); + final List foodItems = []; final Finder finder = Finder( filter: @@ -113,7 +113,7 @@ class DietPlanProviderDB implements DietPlanProviderContract { @override Future updateAll(List items) async { - final List updatedItems = List(); + final List updatedItems = []; for (final DietPlan item in items) { final ApiResponse response = await update(item); @@ -145,7 +145,7 @@ class DietPlanProviderDB implements DietPlanProviderContract { } Map convertItemToStorageMap(DietPlan item) { - final Map values = Map(); + final Map values = {}; // ignore: invalid_use_of_protected_member values['value'] = json.jsonEncode(item.toJson(full: true)); values[keyVarObjectId] = item.objectId; diff --git a/packages/flutter/example/lib/data/repositories/user/provider_db_user.dart b/packages/flutter/example/lib/data/repositories/user/provider_db_user.dart index be2a615bb..c40e3b368 100644 --- a/packages/flutter/example/lib/data/repositories/user/provider_db_user.dart +++ b/packages/flutter/example/lib/data/repositories/user/provider_db_user.dart @@ -82,7 +82,7 @@ class UserProviderDB implements UserProviderContract { void logout(User user) {} Map convertItemToStorageMap(User item) { - final Map values = Map(); + final Map values = {}; // ignore: invalid_use_of_protected_member values['value'] = json.jsonEncode(item.toJson(full: true)); values[keyVarObjectId] = item.objectId; diff --git a/packages/flutter/example/lib/main.dart b/packages/flutter/example/lib/main.dart index 003b9d850..cabbc552e 100644 --- a/packages/flutter/example/lib/main.dart +++ b/packages/flutter/example/lib/main.dart @@ -1,3 +1,5 @@ +// ignore_for_file: avoid_print + import 'dart:convert'; import 'dart:io'; @@ -16,7 +18,7 @@ import 'package:parse_server_sdk_flutter/parse_server_sdk.dart'; void main() { _setTargetPlatformForDesktop(); - runApp(MyApp()); + runApp(const MyApp()); } void _setTargetPlatformForDesktop() { @@ -33,6 +35,8 @@ void _setTargetPlatformForDesktop() { } class MyApp extends StatefulWidget { + const MyApp({Key key}) : super(key: key); + @override _MyAppState createState() => _MyAppState(); } @@ -56,7 +60,7 @@ class _MyAppState extends State { appBar: AppBar( title: const Text('Plugin example app'), ), - body: Center( + body: const Center( //child: Text(text), child: DecisionPage(), //child: HomePage(), diff --git a/packages/flutter/example/lib/pages/decision_page.dart b/packages/flutter/example/lib/pages/decision_page.dart index 33788cfd6..da97929b9 100644 --- a/packages/flutter/example/lib/pages/decision_page.dart +++ b/packages/flutter/example/lib/pages/decision_page.dart @@ -7,6 +7,8 @@ import 'home_page.dart'; import 'login_page.dart'; class DecisionPage extends StatefulWidget { + const DecisionPage({Key key}) : super(key: key); + @override _DecisionPageState createState() => _DecisionPageState(); } @@ -26,20 +28,18 @@ class _DecisionPageState extends State { Widget build(BuildContext context) { return Scaffold( body: Center( - child: Container( - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - _showLogo(), - const SizedBox( - height: 20, - ), - Center( - child: Text(_parseServerState), - ), - ], - ), + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + _showLogo(), + const SizedBox( + height: 20, + ), + Center( + child: Text(_parseServerState), + ), + ], ), ), ); @@ -69,7 +69,7 @@ class _DecisionPageState extends State { if (user != null) { _redirectToPage(context, HomePage(DietPlanProviderApi())); } else { - _redirectToPage(context, LoginPage()); + _redirectToPage(context, const LoginPage()); } } else { setState(() { diff --git a/packages/flutter/example/lib/pages/home_page.dart b/packages/flutter/example/lib/pages/home_page.dart index 4515e9f7f..31298dec3 100644 --- a/packages/flutter/example/lib/pages/home_page.dart +++ b/packages/flutter/example/lib/pages/home_page.dart @@ -8,7 +8,7 @@ import 'package:flutter_plugin_example/data/repositories/diet_plan/contract_prov import 'package:parse_server_sdk/parse_server_sdk.dart'; class HomePage extends StatefulWidget { - const HomePage(this._dietPlanProvider); + const HomePage(this._dietPlanProvider, {Key key}) : super(key: key); final DietPlanProviderContract _dietPlanProvider; @@ -40,7 +40,7 @@ class _HomePageState extends State { automaticallyImplyLeading: false, title: const Text('Parse Server demo'), actions: [ - FlatButton( + TextButton( child: const Text('Logout', style: TextStyle(fontSize: 17.0, color: Colors.white)), onPressed: () async { diff --git a/packages/flutter/example/lib/pages/login_page.dart b/packages/flutter/example/lib/pages/login_page.dart index 54d3fc84e..c91ab0286 100644 --- a/packages/flutter/example/lib/pages/login_page.dart +++ b/packages/flutter/example/lib/pages/login_page.dart @@ -1,10 +1,14 @@ +// ignore_for_file: avoid_print + import 'package:flutter/material.dart'; import 'package:flutter_plugin_example/data/model/user.dart'; import 'package:parse_server_sdk/parse_server_sdk.dart'; -enum FormMode { LOGIN, SIGNUP } +enum FormMode { login, signUp } class LoginPage extends StatefulWidget { + const LoginPage({Key key}) : super(key: key); + @override _LoginPageState createState() => _LoginPageState(); } @@ -17,7 +21,7 @@ class _LoginPageState extends State { String _errorMessage; // Initial form is login form - FormMode _formMode = FormMode.LOGIN; + FormMode _formMode = FormMode.login; bool _isLoading; // Check if form is valid before perform login or signup @@ -41,7 +45,7 @@ class _LoginPageState extends State { ParseResponse response; try { - if (_formMode == FormMode.LOGIN) { + if (_formMode == FormMode.login) { response = await user.login(); print('Signed in'); } else { @@ -52,7 +56,7 @@ class _LoginPageState extends State { _isLoading = false; }); if (response.success) { - if (_formMode == FormMode.LOGIN) { + if (_formMode == FormMode.login) { Navigator.pop(context, true); } } else { @@ -82,7 +86,7 @@ class _LoginPageState extends State { _formKey.currentState.reset(); _errorMessage = ''; setState(() { - _formMode = FormMode.SIGNUP; + _formMode = FormMode.signUp; }); } @@ -90,7 +94,7 @@ class _LoginPageState extends State { _formKey.currentState.reset(); _errorMessage = ''; setState(() { - _formMode = FormMode.LOGIN; + _formMode = FormMode.login; }); } @@ -116,7 +120,7 @@ class _LoginPageState extends State { if (_isLoading) { return const Center(child: CircularProgressIndicator()); } - return Container( + return const SizedBox( height: 0.0, width: 0.0, ); @@ -213,13 +217,13 @@ class _LoginPageState extends State { } Widget _showSecondaryButton() { - return FlatButton( - child: _formMode == FormMode.LOGIN + return TextButton( + child: _formMode == FormMode.login ? const Text('Create an account', style: TextStyle(fontSize: 18.0, fontWeight: FontWeight.w300)) : const Text('Have an account? Sign in', style: TextStyle(fontSize: 18.0, fontWeight: FontWeight.w300)), - onPressed: _formMode == FormMode.LOGIN + onPressed: _formMode == FormMode.login ? _changeFormToSignUp : _changeFormToLogin, ); @@ -230,12 +234,14 @@ class _LoginPageState extends State { padding: const EdgeInsets.fromLTRB(0.0, 45.0, 0.0, 0.0), child: SizedBox( height: 40.0, - child: RaisedButton( - elevation: 5.0, - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(30.0)), - color: Colors.blue, - child: _formMode == FormMode.LOGIN + child: ElevatedButton( + style: ElevatedButton.styleFrom( + primary: Colors.blue, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(30.0)), + elevation: 5.0, + ), + child: _formMode == FormMode.login ? const Text('Login', style: TextStyle(fontSize: 20.0, color: Colors.white)) : const Text('Create account', diff --git a/packages/flutter/example/pubspec.yaml b/packages/flutter/example/pubspec.yaml index 3a0b0179d..f6e011791 100644 --- a/packages/flutter/example/pubspec.yaml +++ b/packages/flutter/example/pubspec.yaml @@ -17,6 +17,7 @@ dependencies: shared_preferences: ^2.0.5 dev_dependencies: + flutter_lints: ^1.0.4 flutter_test: sdk: flutter mockito: ^5.0.2 diff --git a/packages/flutter/example/test/data/repository/diet_plan/repository_diet_plan_api_test.dart b/packages/flutter/example/test/data/repository/diet_plan/repository_diet_plan_api_test.dart index a0f95f909..dcd1a9d68 100644 --- a/packages/flutter/example/test/data/repository/diet_plan/repository_diet_plan_api_test.dart +++ b/packages/flutter/example/test/data/repository/diet_plan/repository_diet_plan_api_test.dart @@ -10,7 +10,7 @@ import '../repository_mock_utils.dart'; // ignore_for_file: invalid_use_of_protected_member void main() { DietPlanProviderContract repository; - SharedPreferences.setMockInitialValues(Map()); + SharedPreferences.setMockInitialValues({}); Future getRepository() async { repository ??= DietPlanProviderApi(); @@ -49,7 +49,7 @@ void main() { test('addAll DietPlan from API', () async { // Given - final List actual = List(); + final List actual = []; final DietPlan item1 = getDummyDietPlan(); item1['objectId'] = null; item1.protein = 5; @@ -117,7 +117,7 @@ void main() { }); test('getAll DietPlan from API', () async { - final List actual = List(); + final List actual = []; final DietPlan item1 = getDummyDietPlan(); item1['objectId'] = null; @@ -162,7 +162,7 @@ void main() { test('updateAll DietPlan from API', () async { // Given - final List actual = List(); + final List actual = []; final DietPlan item1 = getDummyDietPlan(); item1['objectId'] = null; diff --git a/packages/flutter/example/test/data/repository/diet_plan/repository_diet_plan_db_test.dart b/packages/flutter/example/test/data/repository/diet_plan/repository_diet_plan_db_test.dart index 2268d338c..3c5cc9523 100644 --- a/packages/flutter/example/test/data/repository/diet_plan/repository_diet_plan_db_test.dart +++ b/packages/flutter/example/test/data/repository/diet_plan/repository_diet_plan_db_test.dart @@ -11,7 +11,7 @@ import '../repository_mock_utils.dart'; void main() { DietPlanProviderContract repository; - SharedPreferences.setMockInitialValues(Map()); + SharedPreferences.setMockInitialValues({}); StoreRef> _getStore(Database database) { final StoreRef> store = @@ -61,7 +61,7 @@ void main() { test('addAll DietPlan from DB', () async { // Given const String objectIdPrefix = '12345abc'; - final List actual = List(); + final List actual = []; final DietPlan item1 = getDummyDietPlan(); item1.objectId = '${objectIdPrefix}0'; @@ -104,7 +104,7 @@ void main() { const String objectIdPrefix = '12345abc'; final DietPlan item1 = getDummyDietPlan()..objectId = '${objectIdPrefix}0'; final DietPlan item2 = getDummyDietPlan()..objectId = '${objectIdPrefix}1'; - final List actual = List()..add(item1)..add(item2); + final List actual = [item1, item2]; // When final ApiResponse response = await repository.addAll(actual); @@ -168,7 +168,7 @@ void main() { // Given const String objectIdPrefix = '12345abc'; - final List actual = List(); + final List actual = []; final DietPlan item1 = getDummyDietPlan(); item1.objectId = '${objectIdPrefix}0'; actual.add(item1); diff --git a/packages/flutter/example/test/data/repository/diet_plan/repository_diet_plan_test.dart b/packages/flutter/example/test/data/repository/diet_plan/repository_diet_plan_test.dart index adce1b58d..4d959c1db 100644 --- a/packages/flutter/example/test/data/repository/diet_plan/repository_diet_plan_test.dart +++ b/packages/flutter/example/test/data/repository/diet_plan/repository_diet_plan_test.dart @@ -10,7 +10,7 @@ import '../repository_mock_utils.dart'; void main() { DietPlanRepository repository; - SharedPreferences.setMockInitialValues(Map()); + SharedPreferences.setMockInitialValues({}); DietPlanProviderContract apiRepository; DietPlanProviderContract dbRepository; @@ -21,7 +21,7 @@ void main() { const String objectIdPrefix = '12345abc'; final DietPlan item1 = getDummyDietPlan()..objectId = '${objectIdPrefix}0'; final DietPlan item2 = getDummyDietPlan()..objectId = '${objectIdPrefix}1'; - final List mockList = List()..add(item1)..add(item2); + final List mockList = [item1, item2]; when(repositoryApi.add(any)).thenAnswer((_) async => Future.value( diff --git a/packages/flutter/example_livelist/lib/main.dart b/packages/flutter/example_livelist/lib/main.dart index 27da1c64c..c9881962e 100644 --- a/packages/flutter/example_livelist/lib/main.dart +++ b/packages/flutter/example_livelist/lib/main.dart @@ -3,9 +3,11 @@ import 'package:parse_server_sdk_flutter/parse_server_sdk.dart'; import 'application_constants.dart'; -void main() => runApp(MyApp()); +void main() => runApp(const MyApp()); class MyApp extends StatefulWidget { + const MyApp({Key? key}) : super(key: key); + @override _MyAppState createState() => _MyAppState(); } @@ -21,10 +23,11 @@ class _MyAppState extends State { initData().then((bool success) { setState(() { initFailed = !success; - if (success) + if (success) { _queryBuilder = QueryBuilder(ParseObject('Test')) ..orderByAscending('order') ..whereNotEqualTo('show', false); + } }); }).catchError((dynamic _) { setState(() { @@ -86,8 +89,9 @@ class _MyAppState extends State { title: Row( children: [ Flexible( - child: Text( - snapshot.loadedData!.get('order').toString()), + child: Text(snapshot.loadedData! + .get('order') + .toString()), flex: 1, ), Flexible( @@ -102,7 +106,8 @@ class _MyAppState extends State { ], ), onLongPress: () { - objectFormKey.currentState!.setObject(snapshot.loadedData); + objectFormKey.currentState! + .setObject(snapshot.loadedData); }, ); } else { @@ -153,7 +158,8 @@ class _ObjectFormState extends State { Flexible( flex: 1, child: TextFormField( - initialValue: _currentObject!.get('order').toString(), + initialValue: + _currentObject!.get('order').toString(), keyboardType: TextInputType.number, onSaved: (String? value) { _currentObject!.set('order', int.parse(value!)); diff --git a/packages/flutter/example_livelist/pubspec.yaml b/packages/flutter/example_livelist/pubspec.yaml index 028b56a05..dec5862b3 100644 --- a/packages/flutter/example_livelist/pubspec.yaml +++ b/packages/flutter/example_livelist/pubspec.yaml @@ -5,7 +5,7 @@ publish_to: none version: 1.0.0+1 environment: - sdk: ">=2.2.2 <3.0.0" + sdk: ">=2.12.0 <3.0.0" dependencies: flutter: @@ -16,6 +16,7 @@ dependencies: cupertino_icons: ^1.0.2 dev_dependencies: + flutter_lints: ^1.0.4 flutter_test: sdk: flutter mockito: ^5.0.2 diff --git a/packages/flutter/lib/parse_server_sdk.dart b/packages/flutter/lib/parse_server_sdk.dart index 8844aa7f4..a13cc55c1 100644 --- a/packages/flutter/lib/parse_server_sdk.dart +++ b/packages/flutter/lib/parse_server_sdk.dart @@ -6,7 +6,6 @@ import 'dart:ui' as ui; import 'package:connectivity_plus/connectivity_plus.dart'; import 'package:flutter/material.dart'; -import 'package:flutter/widgets.dart'; import 'package:package_info_plus/package_info_plus.dart'; import 'package:parse_server_sdk/parse_server_sdk.dart' as sdk; import 'package:path/path.dart' as path; diff --git a/packages/flutter/lib/src/utils/parse_live_list.dart b/packages/flutter/lib/src/utils/parse_live_list.dart index 9cea74101..7c52b4678 100644 --- a/packages/flutter/lib/src/utils/parse_live_list.dart +++ b/packages/flutter/lib/src/utils/parse_live_list.dart @@ -284,8 +284,9 @@ class _ParseLiveListElementWidgetState sizeFactor: widget.sizeFactor, child: AnimatedSize( duration: widget.duration, - vsync: this, child: widget.childBuilder(context, _snapshot), + // ignore: deprecated_member_use + vsync: this, ), ); return result; diff --git a/packages/flutter/pubspec.yaml b/packages/flutter/pubspec.yaml index 78ef992f7..3a5026348 100644 --- a/packages/flutter/pubspec.yaml +++ b/packages/flutter/pubspec.yaml @@ -4,7 +4,7 @@ version: 3.2.0 homepage: https://github.com/parse-community/Parse-SDK-Flutter environment: - sdk: '>=2.12.0 <3.0.0' + sdk: ">=2.12.0 <3.0.0" dependencies: flutter: @@ -44,6 +44,7 @@ dependency_overrides: platform: ^3.1.0 dev_dependencies: + flutter_lints: ^1.0.4 # Testing flutter_test: sdk: flutter diff --git a/packages/flutter/test/parse_client_configuration_test.dart b/packages/flutter/test/parse_client_configuration_test.dart index f2de6b5cc..6d4f38b95 100644 --- a/packages/flutter/test/parse_client_configuration_test.dart +++ b/packages/flutter/test/parse_client_configuration_test.dart @@ -3,7 +3,7 @@ import 'package:parse_server_sdk_flutter/parse_server_sdk.dart'; import 'package:shared_preferences/shared_preferences.dart'; void main() { - SharedPreferences.setMockInitialValues(Map()); + SharedPreferences.setMockInitialValues({}); test('testBuilder', () async { await Parse().initialize('appId', 'serverUrl', diff --git a/tools/flutter-dependencies.sh b/tools/flutter-dependencies.sh new file mode 100644 index 000000000..aeddd7539 --- /dev/null +++ b/tools/flutter-dependencies.sh @@ -0,0 +1,11 @@ +#!/bin/sh +# This scrip installs the dependencies of the flutter package. +# parse_server_sdk is set to the relative path. + +cd packages/dart +flutter pub get +cd ../.. +cd packages/flutter +flutter pub remove parse_server_sdk +flutter pub add parse_server_sdk --path ../dart +flutter pub get From 93da0e7e378538a7f7e93cc6d4230e2287f0a299 Mon Sep 17 00:00:00 2001 From: Rodrigo de Souza Marques Date: Thu, 2 Jun 2022 19:42:05 -0300 Subject: [PATCH 31/48] Version 3.2.0 ### Bug Fixes * Old version of connectivity_plus package ([#717](https://github.com/parse-community/Parse-SDK-Flutter/issues/717)) * package_info_plus not work in web ([#714](https://github.com/parse-community/Parse-SDK-Flutter/issues/714)) * MissingPluginException (No implementation found for method getAll) ([#712](https://github.com/parse-community/Parse-SDK-Flutter/issues/712)) * Query fails for subclassed Parse object in Parse relation ([#697](https://github.com/parse-community/Parse-SDK-Flutter/issues/697)) * ParseRelation#query - Unhandled Exception: type 'ParseObject' is not a subtype of type ([#696](https://github.com/parse-community/Parse-SDK-Flutter/issues/696)) * Error in progressCallback ([#679](https://github.com/parse-community/Parse-SDK-Flutter/issues/679)) * first: Correct return type ([#661](https://github.com/parse-community/Parse-SDK-Flutter/issues/661)) * ParseLiveListWidget MongoError ([#653](https://github.com/parse-community/Parse-SDK-Flutter/issues/653)) * General improvements * Updated dependencies * Fix Label Platform Web Support in pub.dev - Refactor path_provider access --- packages/dart/CHANGELOG.md | 15 +++++++++++++++ packages/dart/lib/src/utils/parse_live_list.dart | 4 ++-- packages/dart/pubspec.yaml | 10 +++++----- packages/flutter/CHANGELOG.md | 15 +++++++++++++++ packages/flutter/lib/parse_server_sdk.dart | 16 +++++----------- .../lib/src/storage/core_store_directory_io.dart | 11 +++++++++++ .../src/storage/core_store_directory_web.dart | 9 +++++++++ packages/flutter/pubspec.yaml | 12 ++++++------ 8 files changed, 68 insertions(+), 24 deletions(-) create mode 100644 packages/flutter/lib/src/storage/core_store_directory_io.dart create mode 100644 packages/flutter/lib/src/storage/core_store_directory_web.dart diff --git a/packages/dart/CHANGELOG.md b/packages/dart/CHANGELOG.md index b90e82bba..c962db2db 100644 --- a/packages/dart/CHANGELOG.md +++ b/packages/dart/CHANGELOG.md @@ -1,3 +1,18 @@ +## [3.2.0](https://github.com/parse-community/Parse-SDK-Flutter/compare/V3.1.1...flutter-3.2.0) (2022-06-22) + +### Bug Fixes +* Old version of connectivity_plus package ([#717](https://github.com/parse-community/Parse-SDK-Flutter/issues/717)) +* package_info_plus not work in web ([#714](https://github.com/parse-community/Parse-SDK-Flutter/issues/714)) +* MissingPluginException (No implementation found for method getAll) ([#712](https://github.com/parse-community/Parse-SDK-Flutter/issues/712)) +* Query fails for subclassed Parse object in Parse relation ([#697](https://github.com/parse-community/Parse-SDK-Flutter/issues/697)) +* ParseRelation#query - Unhandled Exception: type 'ParseObject' is not a subtype of type ([#696](https://github.com/parse-community/Parse-SDK-Flutter/issues/696)) +* Error in progressCallback ([#679](https://github.com/parse-community/Parse-SDK-Flutter/issues/679)) +* first: Correct return type ([#661](https://github.com/parse-community/Parse-SDK-Flutter/issues/661)) +* ParseLiveListWidget MongoError ([#653](https://github.com/parse-community/Parse-SDK-Flutter/issues/653)) + +* General improvements +* Updated dependencies + ## [3.1.1](https://github.com/parse-community/Parse-SDK-Flutter/compare/V3.1.0...dart-3.1.1) (2022-05-30) ### Refactors diff --git a/packages/dart/lib/src/utils/parse_live_list.dart b/packages/dart/lib/src/utils/parse_live_list.dart index d0cc933fc..a572afdb9 100644 --- a/packages/dart/lib/src/utils/parse_live_list.dart +++ b/packages/dart/lib/src/utils/parse_live_list.dart @@ -31,7 +31,6 @@ class ParseLiveList { } final QueryBuilder _query; - //The included Items, where LiveList should look for updates. final Map _listeningIncludes; final bool _lazyLoading; @@ -144,9 +143,11 @@ class ParseLiveList { return string; }), ); + } if (keys.isNotEmpty) { query.keysToReturn(keys); } + } return await query.query(); } @@ -741,7 +742,6 @@ class PathKey { final String key; Subscription? subscription; - @override String toString() { return 'PathKey(key: $key, subscription: ${subscription?.requestId})'; diff --git a/packages/dart/pubspec.yaml b/packages/dart/pubspec.yaml index f1935b95d..d68f64c05 100644 --- a/packages/dart/pubspec.yaml +++ b/packages/dart/pubspec.yaml @@ -10,7 +10,7 @@ dependencies: # Networking dio: ^4.0.6 http: ^0.13.4 - web_socket_channel: ^2.1.0 + web_socket_channel: ^2.2.0 #Database sembast: ^3.2.0 @@ -24,11 +24,11 @@ dependencies: mime_type: ^1.0.0 dependency_overrides: - path: ^1.8.1 # required for transitive use only + path: ^1.8.2 # required for transitive use only dev_dependencies: lints: ^1.0.1 # Testing - build_runner: ^2.1.10 - mockito: ^5.1.0 - test: ^1.21.0 + build_runner: ^2.1.11 + mockito: ^5.2.0 + test: ^1.21.1 diff --git a/packages/flutter/CHANGELOG.md b/packages/flutter/CHANGELOG.md index 9faf40d91..68f6d875c 100644 --- a/packages/flutter/CHANGELOG.md +++ b/packages/flutter/CHANGELOG.md @@ -1,3 +1,18 @@ +## [3.2.0](https://github.com/parse-community/Parse-SDK-Flutter/compare/V3.1.1...flutter-3.2.0) (2022-06-22) + +### Bug Fixes +* Old version of connectivity_plus package ([#717](https://github.com/parse-community/Parse-SDK-Flutter/issues/717)) +* package_info_plus not work in web ([#714](https://github.com/parse-community/Parse-SDK-Flutter/issues/714)) +* MissingPluginException (No implementation found for method getAll) ([#712](https://github.com/parse-community/Parse-SDK-Flutter/issues/712)) +* Query fails for subclassed Parse object in Parse relation ([#697](https://github.com/parse-community/Parse-SDK-Flutter/issues/697)) +* ParseRelation#query - Unhandled Exception: type 'ParseObject' is not a subtype of type ([#696](https://github.com/parse-community/Parse-SDK-Flutter/issues/696)) +* Error in progressCallback ([#679](https://github.com/parse-community/Parse-SDK-Flutter/issues/679)) +* first: Correct return type ([#661](https://github.com/parse-community/Parse-SDK-Flutter/issues/661)) +* ParseLiveListWidget MongoError ([#653](https://github.com/parse-community/Parse-SDK-Flutter/issues/653)) + +* General improvements +* Updated dependencies + ## [3.1.2](https://github.com/parse-community/Parse-SDK-Flutter/compare/flutter-3.1.1...flutter-3.1.2) (2022-05-30) ### Refactors diff --git a/packages/flutter/lib/parse_server_sdk.dart b/packages/flutter/lib/parse_server_sdk.dart index a13cc55c1..441be678b 100644 --- a/packages/flutter/lib/parse_server_sdk.dart +++ b/packages/flutter/lib/parse_server_sdk.dart @@ -8,8 +8,9 @@ import 'package:connectivity_plus/connectivity_plus.dart'; import 'package:flutter/material.dart'; import 'package:package_info_plus/package_info_plus.dart'; import 'package:parse_server_sdk/parse_server_sdk.dart' as sdk; +import 'package:parse_server_sdk_flutter/src/storage/core_store_directory_io.dart' + if (dart.library.html) 'package:parse_server_sdk_flutter/src/storage/core_store_directory_web.dart'; import 'package:path/path.dart' as path; -import 'package:path_provider/path_provider.dart'; import 'package:sembast/sembast.dart'; import 'package:shared_preferences/shared_preferences.dart'; @@ -90,8 +91,8 @@ class Parse extends sdk.Parse parseFileConstructor: parseFileConstructor, liveListRetryIntervals: liveListRetryIntervals, connectivityProvider: connectivityProvider ?? this, - fileDirectory: fileDirectory ?? - (!sdk.parseIsWeb ? (await getTemporaryDirectory()).path : null), + fileDirectory: + fileDirectory ?? (await CoreStoreDirectory().getTempDirectory()), appResumedStream: appResumedStream ?? _appResumedStreamController.stream, clientCreator: clientCreator, ) as Parse; @@ -136,14 +137,7 @@ class Parse extends sdk.Parse Future dbDirectory() async { String dbDirectory = ''; - if (!sdk.parseIsWeb && - (Platform.isIOS || - Platform.isAndroid || - Platform.isMacOS || - Platform.isLinux || - Platform.isWindows)) { - dbDirectory = (await getApplicationDocumentsDirectory()).path; - } + dbDirectory = await CoreStoreDirectory().getDatabaseDirectory(); return path.join('$dbDirectory/parse', 'parse.db'); } diff --git a/packages/flutter/lib/src/storage/core_store_directory_io.dart b/packages/flutter/lib/src/storage/core_store_directory_io.dart new file mode 100644 index 000000000..325939228 --- /dev/null +++ b/packages/flutter/lib/src/storage/core_store_directory_io.dart @@ -0,0 +1,11 @@ +import 'package:path_provider/path_provider.dart'; + +class CoreStoreDirectory { + Future getDatabaseDirectory() async { + return (await getApplicationDocumentsDirectory()).path; + } + + Future getTempDirectory() async { + return (await getTemporaryDirectory()).path; + } +} diff --git a/packages/flutter/lib/src/storage/core_store_directory_web.dart b/packages/flutter/lib/src/storage/core_store_directory_web.dart new file mode 100644 index 000000000..a62268c91 --- /dev/null +++ b/packages/flutter/lib/src/storage/core_store_directory_web.dart @@ -0,0 +1,9 @@ +class CoreStoreDirectory { + Future getDatabaseDirectory() async { + return ''; + } + + Future getTempDirectory() async { + return ''; + } +} diff --git a/packages/flutter/pubspec.yaml b/packages/flutter/pubspec.yaml index 3a5026348..76c3deafb 100644 --- a/packages/flutter/pubspec.yaml +++ b/packages/flutter/pubspec.yaml @@ -11,11 +11,11 @@ dependencies: sdk: flutter #Uncomment for Release version - parse_server_sdk: ^3.2.0 + #parse_server_sdk: ^3.2.0 # Uncomment for local testing - #parse_server_sdk: - # path: ../dart + parse_server_sdk: + path: ../dart # Uncomment for test with Github Branch # parse_server_sdk: @@ -37,10 +37,10 @@ dependencies: package_info_plus: ^1.4.2 # only used in the flutter part sembast: ^3.2.0 sembast_web: ^2.0.1+1 - path: ^1.8.0 # required for transitive use only + path: ^1.8.1 # required for transitive use only dependency_overrides: - path: ^1.8.1 # required for transitive use only + path: ^1.8.2 # required for transitive use only platform: ^3.1.0 dev_dependencies: @@ -48,4 +48,4 @@ dev_dependencies: # Testing flutter_test: sdk: flutter - mockito: ^5.1.0 + mockito: ^5.2.0 From 600976437d9ff9863b71cc4b94bafbc344cde65c Mon Sep 17 00:00:00 2001 From: Rodrigo de Souza Marques Date: Thu, 2 Jun 2022 19:52:28 -0300 Subject: [PATCH 32/48] Update pubspec.yaml --- packages/flutter/pubspec.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/flutter/pubspec.yaml b/packages/flutter/pubspec.yaml index 76c3deafb..701bc8089 100644 --- a/packages/flutter/pubspec.yaml +++ b/packages/flutter/pubspec.yaml @@ -11,11 +11,11 @@ dependencies: sdk: flutter #Uncomment for Release version - #parse_server_sdk: ^3.2.0 + parse_server_sdk: ^3.2.0 # Uncomment for local testing - parse_server_sdk: - path: ../dart + #parse_server_sdk: + # path: ../dart # Uncomment for test with Github Branch # parse_server_sdk: From 736394ee3bb9179b2313fbd6cde6d13468c25c18 Mon Sep 17 00:00:00 2001 From: Rodrigo de Souza Marques Date: Fri, 3 Jun 2022 08:13:58 -0300 Subject: [PATCH 33/48] Update .gitignore --- .gitignore | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 2c60b1faf..39010478a 100644 --- a/.gitignore +++ b/.gitignore @@ -102,6 +102,7 @@ unlinked_spec.ds # macOS **/macos/Flutter/GeneratedPluginRegistrant.swift +**/macos/flutter/ephemeral/ # Linux **/linux/flutter/ephemeral @@ -120,5 +121,4 @@ app.*.symbols !**/ios/**/default.perspectivev3 !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages !/dev/ci/**/Gemfile.lock -/packages/flutter/example/linux/flutter/ephemeral/ -/packages/flutter/example/macos/Flutter/ephemeral/ + From b7ae7b4c546011e6fe914ca2186240317807d380 Mon Sep 17 00:00:00 2001 From: Rodrigo de Souza Marques Date: Fri, 3 Jun 2022 08:27:42 -0300 Subject: [PATCH 34/48] Update CHANGELOG / README --- packages/dart/CHANGELOG.md | 18 ++++++++---------- packages/flutter/README.md | 2 +- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/packages/dart/CHANGELOG.md b/packages/dart/CHANGELOG.md index c962db2db..5ba93d6e7 100644 --- a/packages/dart/CHANGELOG.md +++ b/packages/dart/CHANGELOG.md @@ -1,17 +1,15 @@ ## [3.2.0](https://github.com/parse-community/Parse-SDK-Flutter/compare/V3.1.1...flutter-3.2.0) (2022-06-22) ### Bug Fixes -* Old version of connectivity_plus package ([#717](https://github.com/parse-community/Parse-SDK-Flutter/issues/717)) -* package_info_plus not work in web ([#714](https://github.com/parse-community/Parse-SDK-Flutter/issues/714)) -* MissingPluginException (No implementation found for method getAll) ([#712](https://github.com/parse-community/Parse-SDK-Flutter/issues/712)) -* Query fails for subclassed Parse object in Parse relation ([#697](https://github.com/parse-community/Parse-SDK-Flutter/issues/697)) -* ParseRelation#query - Unhandled Exception: type 'ParseObject' is not a subtype of type ([#696](https://github.com/parse-community/Parse-SDK-Flutter/issues/696)) -* Error in progressCallback ([#679](https://github.com/parse-community/Parse-SDK-Flutter/issues/679)) -* first: Correct return type ([#661](https://github.com/parse-community/Parse-SDK-Flutter/issues/661)) -* ParseLiveListWidget MongoError ([#653](https://github.com/parse-community/Parse-SDK-Flutter/issues/653)) -* General improvements -* Updated dependencies +* old version of `connectivity_plus package` ([#717](https://github.com/parse-community/Parse-SDK-Flutter/issues/717)) +* dependency `package_info_plus` does not work in web ([#714](https://github.com/parse-community/Parse-SDK-Flutter/issues/714)) +* missing plugin exception, no implementation found for method `getAll` ([#712](https://github.com/parse-community/Parse-SDK-Flutter/issues/712)) +* query fails for subclassed `ParseObject` in `ParseRelation` ([#697](https://github.com/parse-community/Parse-SDK-Flutter/issues/697)) +* unhandled exception in `ParseRelation`, type `ParseObject` is not a subtype of type ([#696](https://github.com/parse-community/Parse-SDK-Flutter/issues/696)) +* error in progress callback ([#679](https://github.com/parse-community/Parse-SDK-Flutter/issues/679)) +* incorrect return type when calling `first()` ([#661](https://github.com/parse-community/Parse-SDK-Flutter/issues/661)) +* error in `ParseLiveListWidget` when enabling `lazyloading` ([#653](https://github.com/parse-community/Parse-SDK-Flutter/issues/653)) ## [3.1.1](https://github.com/parse-community/Parse-SDK-Flutter/compare/V3.1.0...dart-3.1.1) (2022-05-30) diff --git a/packages/flutter/README.md b/packages/flutter/README.md index 1830736c4..fe1ea8df9 100644 --- a/packages/flutter/README.md +++ b/packages/flutter/README.md @@ -81,7 +81,7 @@ When running directly via docker, set the env var `PARSE_SERVER_ALLOW_HEADERS=X- When running via express, set [ParseServerOptions](https://parseplatform.org/parse-server/api/master/ParseServerOptions.html) `allowHeaders: ['X-Parse-Installation-Id']`. #### Desktop Support (macOS) -Due to security entitlements posed by the macOS framework, connecting to the Web and sharing data requires adding the following lines to code : +The security entitlements posed by the macOS framework require that your app is granted permission to open outgoing network connections, so that the Parse Flutter SDK can communicate with Parse Server. To grant this permission, add the following lines: ``` com.apple.security.network.client From 749bb40a63d00bb7a36cdc0d16c6aa0031aaf50e Mon Sep 17 00:00:00 2001 From: Rodrigo de Souza Marques Date: Fri, 3 Jun 2022 08:39:31 -0300 Subject: [PATCH 35/48] Added instructions for using ACL with ParseRole --- packages/dart/README.md | 7 +++++++ packages/flutter/README.md | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/packages/dart/README.md b/packages/dart/README.md index 766f358e0..2e0477b21 100644 --- a/packages/dart/README.md +++ b/packages/dart/README.md @@ -739,6 +739,13 @@ You can retrieve the ACL list of an object using: ParseACL parseACL = parseObject.getACL(); ``` +To set the ACL to `ParseRole` use: + +```dart +parseACL.setReadAccess(userId: "role:ROLE_NAME", allowed: true); +parseACL.setWriteAccess(userId: "role:ROLE_NAME", allowed: true); + +``` ## Config The SDK supports Parse Config. A map of all configs can be grabbed from the server by calling : ```dart diff --git a/packages/flutter/README.md b/packages/flutter/README.md index fe1ea8df9..563af2194 100644 --- a/packages/flutter/README.md +++ b/packages/flutter/README.md @@ -857,6 +857,13 @@ You can retrieve the ACL list of an object using: ParseACL parseACL = parseObject.getACL(); ``` +To set the ACL to `ParseRole` use: + +```dart +parseACL.setReadAccess(userId: "role:ROLE_NAME", allowed: true); +parseACL.setWriteAccess(userId: "role:ROLE_NAME", allowed: true); +``` + ## Config The SDK supports Parse Config. A map of all configs can be grabbed from the server by calling : ```dart From 1460a5e09c32f86b08f6de4f6a61333cad65906d Mon Sep 17 00:00:00 2001 From: Rodrigo de Souza Marques Date: Fri, 3 Jun 2022 08:46:40 -0300 Subject: [PATCH 36/48] CHANGELOG update --- packages/dart/CHANGELOG.md | 4 ++++ packages/flutter/CHANGELOG.md | 5 +++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/packages/dart/CHANGELOG.md b/packages/dart/CHANGELOG.md index 5ba93d6e7..1e82ddf9c 100644 --- a/packages/dart/CHANGELOG.md +++ b/packages/dart/CHANGELOG.md @@ -11,6 +11,10 @@ * incorrect return type when calling `first()` ([#661](https://github.com/parse-community/Parse-SDK-Flutter/issues/661)) * error in `ParseLiveListWidget` when enabling `lazyloading` ([#653](https://github.com/parse-community/Parse-SDK-Flutter/issues/653)) +### Features + +* upgrade various dependencies + ## [3.1.1](https://github.com/parse-community/Parse-SDK-Flutter/compare/V3.1.0...dart-3.1.1) (2022-05-30) ### Refactors diff --git a/packages/flutter/CHANGELOG.md b/packages/flutter/CHANGELOG.md index 68f6d875c..e1badefe7 100644 --- a/packages/flutter/CHANGELOG.md +++ b/packages/flutter/CHANGELOG.md @@ -10,8 +10,9 @@ * first: Correct return type ([#661](https://github.com/parse-community/Parse-SDK-Flutter/issues/661)) * ParseLiveListWidget MongoError ([#653](https://github.com/parse-community/Parse-SDK-Flutter/issues/653)) -* General improvements -* Updated dependencies +### Features + +* upgrade various dependencies ## [3.1.2](https://github.com/parse-community/Parse-SDK-Flutter/compare/flutter-3.1.1...flutter-3.1.2) (2022-05-30) From 9fdb42dd593e13421609c3e10dfd526695fd2985 Mon Sep 17 00:00:00 2001 From: Rodrigo de Souza Marques Date: Mon, 6 Jun 2022 00:56:11 -0300 Subject: [PATCH 37/48] Adjustments requested in PR --- packages/dart/CHANGELOG.md | 8 ++------ .../dart/lib/src/base/parse_constants.dart | 2 +- packages/dart/pubspec.yaml | 2 +- packages/flutter/CHANGELOG.md | 19 ++++++++----------- packages/flutter/pubspec.yaml | 12 ++---------- 5 files changed, 14 insertions(+), 29 deletions(-) diff --git a/packages/dart/CHANGELOG.md b/packages/dart/CHANGELOG.md index 1e82ddf9c..fef0feb43 100644 --- a/packages/dart/CHANGELOG.md +++ b/packages/dart/CHANGELOG.md @@ -1,11 +1,7 @@ -## [3.2.0](https://github.com/parse-community/Parse-SDK-Flutter/compare/V3.1.1...flutter-3.2.0) (2022-06-22) +## [3.1.2](https://github.com/parse-community/Parse-SDK-Flutter/compare/V3.1.1...flutter-3.1.2) (2022-06-06) ### Bug Fixes -* old version of `connectivity_plus package` ([#717](https://github.com/parse-community/Parse-SDK-Flutter/issues/717)) -* dependency `package_info_plus` does not work in web ([#714](https://github.com/parse-community/Parse-SDK-Flutter/issues/714)) -* missing plugin exception, no implementation found for method `getAll` ([#712](https://github.com/parse-community/Parse-SDK-Flutter/issues/712)) -* query fails for subclassed `ParseObject` in `ParseRelation` ([#697](https://github.com/parse-community/Parse-SDK-Flutter/issues/697)) * unhandled exception in `ParseRelation`, type `ParseObject` is not a subtype of type ([#696](https://github.com/parse-community/Parse-SDK-Flutter/issues/696)) * error in progress callback ([#679](https://github.com/parse-community/Parse-SDK-Flutter/issues/679)) * incorrect return type when calling `first()` ([#661](https://github.com/parse-community/Parse-SDK-Flutter/issues/661)) @@ -13,7 +9,7 @@ ### Features -* upgrade various dependencies +* Upgrade dependencies version ## [3.1.1](https://github.com/parse-community/Parse-SDK-Flutter/compare/V3.1.0...dart-3.1.1) (2022-05-30) diff --git a/packages/dart/lib/src/base/parse_constants.dart b/packages/dart/lib/src/base/parse_constants.dart index 86bc88267..73b230cd1 100644 --- a/packages/dart/lib/src/base/parse_constants.dart +++ b/packages/dart/lib/src/base/parse_constants.dart @@ -1,7 +1,7 @@ part of flutter_parse_sdk; // Library -const String keySdkVersion = '3.2.0'; +const String keySdkVersion = '3.1.2'; const String keyLibraryName = 'Flutter Parse SDK'; // End Points diff --git a/packages/dart/pubspec.yaml b/packages/dart/pubspec.yaml index d68f64c05..5b73def94 100644 --- a/packages/dart/pubspec.yaml +++ b/packages/dart/pubspec.yaml @@ -1,6 +1,6 @@ name: parse_server_sdk description: Dart plugin for Parse Server, (https://parseplatform.org), (https://back4app.com) -version: 3.2.0 +version: 3.1.2 homepage: https://github.com/parse-community/Parse-SDK-Flutter environment: diff --git a/packages/flutter/CHANGELOG.md b/packages/flutter/CHANGELOG.md index e1badefe7..3ed6d2ce4 100644 --- a/packages/flutter/CHANGELOG.md +++ b/packages/flutter/CHANGELOG.md @@ -1,18 +1,15 @@ -## [3.2.0](https://github.com/parse-community/Parse-SDK-Flutter/compare/V3.1.1...flutter-3.2.0) (2022-06-22) +## [3.1.3](https://github.com/parse-community/Parse-SDK-Flutter/compare/V3.1.2...flutter-3.1.3) (2022-06-06) ### Bug Fixes -* Old version of connectivity_plus package ([#717](https://github.com/parse-community/Parse-SDK-Flutter/issues/717)) -* package_info_plus not work in web ([#714](https://github.com/parse-community/Parse-SDK-Flutter/issues/714)) -* MissingPluginException (No implementation found for method getAll) ([#712](https://github.com/parse-community/Parse-SDK-Flutter/issues/712)) -* Query fails for subclassed Parse object in Parse relation ([#697](https://github.com/parse-community/Parse-SDK-Flutter/issues/697)) -* ParseRelation#query - Unhandled Exception: type 'ParseObject' is not a subtype of type ([#696](https://github.com/parse-community/Parse-SDK-Flutter/issues/696)) -* Error in progressCallback ([#679](https://github.com/parse-community/Parse-SDK-Flutter/issues/679)) -* first: Correct return type ([#661](https://github.com/parse-community/Parse-SDK-Flutter/issues/661)) -* ParseLiveListWidget MongoError ([#653](https://github.com/parse-community/Parse-SDK-Flutter/issues/653)) -### Features +* old version of `connectivity_plus package` ([#717](https://github.com/parse-community/Parse-SDK-Flutter/issues/717)) +* dependency `package_info_plus` does not work in web ([#714](https://github.com/parse-community/Parse-SDK-Flutter/issues/714)) +* missing plugin exception, no implementation found for method `getAll` ([#712](https://github.com/parse-community/Parse-SDK-Flutter/issues/712)) + +### BREAKING CHANGES -* upgrade various dependencies +* upgrade various dependencies by major versions; check whether you need to make change to your code if you are using any of these transitive dependencies that have been upgraded: +- connectivity_plus ## [3.1.2](https://github.com/parse-community/Parse-SDK-Flutter/compare/flutter-3.1.1...flutter-3.1.2) (2022-05-30) diff --git a/packages/flutter/pubspec.yaml b/packages/flutter/pubspec.yaml index 701bc8089..0c9bdfd95 100644 --- a/packages/flutter/pubspec.yaml +++ b/packages/flutter/pubspec.yaml @@ -1,6 +1,6 @@ name: parse_server_sdk_flutter description: Flutter plugin for Parse Server, (https://parseplatform.org), (https://back4app.com) -version: 3.2.0 +version: 3.1.3 homepage: https://github.com/parse-community/Parse-SDK-Flutter environment: @@ -11,26 +11,18 @@ dependencies: sdk: flutter #Uncomment for Release version - parse_server_sdk: ^3.2.0 + parse_server_sdk: ^3.1.2 # Uncomment for local testing #parse_server_sdk: # path: ../dart - # Uncomment for test with Github Branch -# parse_server_sdk: -# git: -# url: https://github.com/parse-community/Parse-SDK-Flutter.git -# ref: development -# path: packages/dart - # Networking dio: ^4.0.6 connectivity_plus: ^2.3.0 # only used in the flutter part #Database shared_preferences: ^2.0.13 # only used in the flutter part - #shared_preferences_web: ^2.0.3 # Utils path_provider: ^2.0.9 # only used in the flutter part From b6f1a5e40cf8ea9be4136adae8862e9bbd5e40cf Mon Sep 17 00:00:00 2001 From: Rodrigo de Souza Marques Date: Mon, 6 Jun 2022 01:11:30 -0300 Subject: [PATCH 38/48] Update pubspec.yaml --- packages/flutter/pubspec.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/flutter/pubspec.yaml b/packages/flutter/pubspec.yaml index 0c9bdfd95..24fb98877 100644 --- a/packages/flutter/pubspec.yaml +++ b/packages/flutter/pubspec.yaml @@ -19,13 +19,13 @@ dependencies: # Networking dio: ^4.0.6 - connectivity_plus: ^2.3.0 # only used in the flutter part + connectivity_plus: ^2.3.2 # only used in the flutter part #Database - shared_preferences: ^2.0.13 # only used in the flutter part + shared_preferences: ^2.0.15 # only used in the flutter part # Utils - path_provider: ^2.0.9 # only used in the flutter part + path_provider: ^2.0.10 # only used in the flutter part package_info_plus: ^1.4.2 # only used in the flutter part sembast: ^3.2.0 sembast_web: ^2.0.1+1 From a23fb59154aa3ae592b3ab6cbaba2b5c96ca80da Mon Sep 17 00:00:00 2001 From: Rodrigo de Souza Marques Date: Wed, 8 Jun 2022 01:55:18 -0300 Subject: [PATCH 39/48] Update CHANGELOG.md --- packages/dart/CHANGELOG.md | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/packages/dart/CHANGELOG.md b/packages/dart/CHANGELOG.md index fef0feb43..e8b366989 100644 --- a/packages/dart/CHANGELOG.md +++ b/packages/dart/CHANGELOG.md @@ -6,10 +6,7 @@ * error in progress callback ([#679](https://github.com/parse-community/Parse-SDK-Flutter/issues/679)) * incorrect return type when calling `first()` ([#661](https://github.com/parse-community/Parse-SDK-Flutter/issues/661)) * error in `ParseLiveListWidget` when enabling `lazyloading` ([#653](https://github.com/parse-community/Parse-SDK-Flutter/issues/653)) - -### Features - -* Upgrade dependencies version +* fixes an error that occurs when the logout method is called and the user does not have an access token, for example, after creating an account that must be verified ## [3.1.1](https://github.com/parse-community/Parse-SDK-Flutter/compare/V3.1.0...dart-3.1.1) (2022-05-30) From 7c84251c545099cf83b5d50f621ffd40266db2a5 Mon Sep 17 00:00:00 2001 From: Rodrigo de Souza Marques Date: Sat, 11 Jun 2022 09:47:19 -0300 Subject: [PATCH 40/48] Fix revision comments --- packages/dart/CHANGELOG.md | 2 +- packages/flutter/CHANGELOG.md | 7 ++----- packages/flutter/pubspec.yaml | 2 -- 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/packages/dart/CHANGELOG.md b/packages/dart/CHANGELOG.md index e8b366989..02ec27caf 100644 --- a/packages/dart/CHANGELOG.md +++ b/packages/dart/CHANGELOG.md @@ -1,4 +1,4 @@ -## [3.1.2](https://github.com/parse-community/Parse-SDK-Flutter/compare/V3.1.1...flutter-3.1.2) (2022-06-06) +## [3.1.2](https://github.com/parse-community/Parse-SDK-Flutter/compare/dart-3.1.1...dart-3.1.2) (2022-06-10) ### Bug Fixes diff --git a/packages/flutter/CHANGELOG.md b/packages/flutter/CHANGELOG.md index 3ed6d2ce4..3e38b9055 100644 --- a/packages/flutter/CHANGELOG.md +++ b/packages/flutter/CHANGELOG.md @@ -1,4 +1,4 @@ -## [3.1.3](https://github.com/parse-community/Parse-SDK-Flutter/compare/V3.1.2...flutter-3.1.3) (2022-06-06) +## [3.1.3](https://github.com/parse-community/Parse-SDK-Flutter/compare/flutter-3.1.2...flutter-3.1.3) (2022-06-10) ### Bug Fixes @@ -6,10 +6,7 @@ * dependency `package_info_plus` does not work in web ([#714](https://github.com/parse-community/Parse-SDK-Flutter/issues/714)) * missing plugin exception, no implementation found for method `getAll` ([#712](https://github.com/parse-community/Parse-SDK-Flutter/issues/712)) -### BREAKING CHANGES - -* upgrade various dependencies by major versions; check whether you need to make change to your code if you are using any of these transitive dependencies that have been upgraded: -- connectivity_plus +### Upgrade dependencies ## [3.1.2](https://github.com/parse-community/Parse-SDK-Flutter/compare/flutter-3.1.1...flutter-3.1.2) (2022-05-30) diff --git a/packages/flutter/pubspec.yaml b/packages/flutter/pubspec.yaml index 24fb98877..1e4ab280b 100644 --- a/packages/flutter/pubspec.yaml +++ b/packages/flutter/pubspec.yaml @@ -10,9 +10,7 @@ dependencies: flutter: sdk: flutter - #Uncomment for Release version parse_server_sdk: ^3.1.2 - # Uncomment for local testing #parse_server_sdk: # path: ../dart From b2e676d5a6c13444ad73a067811fa10c4f474d75 Mon Sep 17 00:00:00 2001 From: Manuel <5673677+mtrezza@users.noreply.github.com> Date: Sat, 11 Jun 2022 19:28:05 +0200 Subject: [PATCH 41/48] Update packages/flutter/CHANGELOG.md --- packages/flutter/CHANGELOG.md | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/flutter/CHANGELOG.md b/packages/flutter/CHANGELOG.md index 3e38b9055..7d65e11c1 100644 --- a/packages/flutter/CHANGELOG.md +++ b/packages/flutter/CHANGELOG.md @@ -6,7 +6,6 @@ * dependency `package_info_plus` does not work in web ([#714](https://github.com/parse-community/Parse-SDK-Flutter/issues/714)) * missing plugin exception, no implementation found for method `getAll` ([#712](https://github.com/parse-community/Parse-SDK-Flutter/issues/712)) -### Upgrade dependencies ## [3.1.2](https://github.com/parse-community/Parse-SDK-Flutter/compare/flutter-3.1.1...flutter-3.1.2) (2022-05-30) From 8b9ff93f5ee73bf889dbf75bc67e782098ff5e39 Mon Sep 17 00:00:00 2001 From: Manuel <5673677+mtrezza@users.noreply.github.com> Date: Sat, 11 Jun 2022 19:28:14 +0200 Subject: [PATCH 42/48] Update packages/dart/CHANGELOG.md --- packages/dart/CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/dart/CHANGELOG.md b/packages/dart/CHANGELOG.md index 02ec27caf..00d0917aa 100644 --- a/packages/dart/CHANGELOG.md +++ b/packages/dart/CHANGELOG.md @@ -1,4 +1,4 @@ -## [3.1.2](https://github.com/parse-community/Parse-SDK-Flutter/compare/dart-3.1.1...dart-3.1.2) (2022-06-10) +## [3.1.2](https://github.com/parse-community/Parse-SDK-Flutter/compare/dart-3.1.1...dart-3.1.2) (2022-06-11) ### Bug Fixes From 1e12516f4e1118a633b1c97c459615fbb10fc898 Mon Sep 17 00:00:00 2001 From: Manuel <5673677+mtrezza@users.noreply.github.com> Date: Sat, 11 Jun 2022 19:28:20 +0200 Subject: [PATCH 43/48] Update packages/flutter/CHANGELOG.md --- packages/flutter/CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/flutter/CHANGELOG.md b/packages/flutter/CHANGELOG.md index 7d65e11c1..5f74cc23f 100644 --- a/packages/flutter/CHANGELOG.md +++ b/packages/flutter/CHANGELOG.md @@ -1,4 +1,4 @@ -## [3.1.3](https://github.com/parse-community/Parse-SDK-Flutter/compare/flutter-3.1.2...flutter-3.1.3) (2022-06-10) +## [3.1.3](https://github.com/parse-community/Parse-SDK-Flutter/compare/flutter-3.1.2...flutter-3.1.3) (2022-06-11) ### Bug Fixes From 42e0dc8a7d02007a379d5c68cc88bfac132f5da8 Mon Sep 17 00:00:00 2001 From: Rodrigo de Souza Marques Date: Tue, 28 Jun 2022 21:10:25 -0300 Subject: [PATCH 44/48] Update flutter-dependencies.bat --- tools/flutter-dependencies.bat | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tools/flutter-dependencies.bat b/tools/flutter-dependencies.bat index 3728eecb1..62b47bf34 100644 --- a/tools/flutter-dependencies.bat +++ b/tools/flutter-dependencies.bat @@ -1,7 +1,8 @@ +call flutter config --no-analytics cd packages/dart -flutter pub get +call flutter pub get cd ../.. cd packages/flutter -flutter pub remove parse_server_sdk -flutter pub add parse_server_sdk --path ../dart -flutter pub get +call flutter pub remove parse_server_sdk +call flutter pub add parse_server_sdk --path ../dart +call flutter pub get \ No newline at end of file From fa1cbb95a942e056e5e268425a27bdd374b15b79 Mon Sep 17 00:00:00 2001 From: Manuel <5673677+mtrezza@users.noreply.github.com> Date: Thu, 30 Jun 2022 13:06:02 +0200 Subject: [PATCH 45/48] Update packages/dart/CHANGELOG.md --- packages/dart/CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/dart/CHANGELOG.md b/packages/dart/CHANGELOG.md index 00d0917aa..d84191b82 100644 --- a/packages/dart/CHANGELOG.md +++ b/packages/dart/CHANGELOG.md @@ -1,4 +1,4 @@ -## [3.1.2](https://github.com/parse-community/Parse-SDK-Flutter/compare/dart-3.1.1...dart-3.1.2) (2022-06-11) +## [3.1.2](https://github.com/parse-community/Parse-SDK-Flutter/compare/dart-3.1.1...dart-3.1.2) (2022-07-01) ### Bug Fixes From bbe1e91745ca808cfc1cf85f564f83fd3eca712a Mon Sep 17 00:00:00 2001 From: Manuel <5673677+mtrezza@users.noreply.github.com> Date: Thu, 30 Jun 2022 13:06:08 +0200 Subject: [PATCH 46/48] Update packages/flutter/CHANGELOG.md --- packages/flutter/CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/flutter/CHANGELOG.md b/packages/flutter/CHANGELOG.md index 5f74cc23f..8e0857d42 100644 --- a/packages/flutter/CHANGELOG.md +++ b/packages/flutter/CHANGELOG.md @@ -1,4 +1,4 @@ -## [3.1.3](https://github.com/parse-community/Parse-SDK-Flutter/compare/flutter-3.1.2...flutter-3.1.3) (2022-06-11) +## [3.1.3](https://github.com/parse-community/Parse-SDK-Flutter/compare/flutter-3.1.2...flutter-3.1.3) (2022-07-01) ### Bug Fixes From 7800000531ae96bfe176a8a286084f59858338e9 Mon Sep 17 00:00:00 2001 From: Rodrigo de Souza Marques Date: Thu, 7 Jul 2022 01:40:44 -0300 Subject: [PATCH 47/48] Update CHANGELOG.md Bug 770 --- packages/dart/CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/dart/CHANGELOG.md b/packages/dart/CHANGELOG.md index d84191b82..58980e3db 100644 --- a/packages/dart/CHANGELOG.md +++ b/packages/dart/CHANGELOG.md @@ -6,7 +6,7 @@ * error in progress callback ([#679](https://github.com/parse-community/Parse-SDK-Flutter/issues/679)) * incorrect return type when calling `first()` ([#661](https://github.com/parse-community/Parse-SDK-Flutter/issues/661)) * error in `ParseLiveListWidget` when enabling `lazyloading` ([#653](https://github.com/parse-community/Parse-SDK-Flutter/issues/653)) -* fixes an error that occurs when the logout method is called and the user does not have an access token, for example, after creating an account that must be verified +* Unexpected null value after call user.logout() ([#770](https://github.com/parse-community/Parse-SDK-Flutter/issues/770)) ## [3.1.1](https://github.com/parse-community/Parse-SDK-Flutter/compare/V3.1.0...dart-3.1.1) (2022-05-30) From 7b738ee52dcdd56ae4ccc09de1d5e7ff43e3180d Mon Sep 17 00:00:00 2001 From: Manuel <5673677+mtrezza@users.noreply.github.com> Date: Thu, 7 Jul 2022 12:04:54 +0200 Subject: [PATCH 48/48] Update packages/dart/CHANGELOG.md --- packages/dart/CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/dart/CHANGELOG.md b/packages/dart/CHANGELOG.md index 58980e3db..e8ddb6d81 100644 --- a/packages/dart/CHANGELOG.md +++ b/packages/dart/CHANGELOG.md @@ -6,7 +6,7 @@ * error in progress callback ([#679](https://github.com/parse-community/Parse-SDK-Flutter/issues/679)) * incorrect return type when calling `first()` ([#661](https://github.com/parse-community/Parse-SDK-Flutter/issues/661)) * error in `ParseLiveListWidget` when enabling `lazyloading` ([#653](https://github.com/parse-community/Parse-SDK-Flutter/issues/653)) -* Unexpected null value after call user.logout() ([#770](https://github.com/parse-community/Parse-SDK-Flutter/issues/770)) +* unexpected null value after call `user.logout()` ([#770](https://github.com/parse-community/Parse-SDK-Flutter/issues/770)) ## [3.1.1](https://github.com/parse-community/Parse-SDK-Flutter/compare/V3.1.0...dart-3.1.1) (2022-05-30)