Skip to content

Commit f40cb52

Browse files
Merge pull request #650 from parse-community/nullsafety
Release V3.1.0
2 parents aa6bed5 + 1b8f604 commit f40cb52

File tree

81 files changed

+1636
-7230
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

81 files changed

+1636
-7230
lines changed

.gitignore

+95-12
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,64 @@
1+
# Miscellaneous
2+
*.class
3+
*.lock
4+
*.log
5+
*.pyc
6+
*.swp
17
.DS_Store
2-
.dart_tool/
8+
.atom/
9+
.buildlog/
310
.history
4-
.packages
5-
.pub/
6-
pubspec.lock
7-
.example/lib/application_constants.dart
11+
.svn/
812

913
# IntelliJ related
1014
*.iml
1115
*.ipr
1216
*.iws
1317
.idea/
1418

19+
# Visual Studio Code related
20+
.classpath
21+
.project
22+
.settings/
23+
.vscode/
24+
25+
# Flutter repo-specific
26+
/bin/cache/
27+
/bin/internal/bootstrap.bat
28+
/bin/internal/bootstrap.sh
29+
/bin/mingit/
30+
/dev/benchmarks/mega_gallery/
31+
/dev/bots/.recipe_deps
32+
/dev/bots/android_tools/
33+
/dev/devicelab/ABresults*.json
34+
/dev/docs/doc/
35+
/dev/docs/flutter.docs.zip
36+
/dev/docs/lib/
37+
/dev/docs/pubspec.yaml
38+
/dev/integration_tests/**/xcuserdata
39+
/dev/integration_tests/**/Pods
40+
/packages/flutter/coverage/
41+
version
42+
analysis_benchmark.json
43+
44+
# packages file containing multi-root paths
45+
.packages.generated
46+
47+
# Flutter/Dart/Pub related
48+
**/doc/api/
49+
.dart_tool/
50+
.flutter-plugins
51+
.flutter-plugins-dependencies
52+
**/generated_plugin_registrant.dart
53+
.packages
54+
.pub-cache/
55+
.pub/
56+
build/
57+
flutter_*.png
58+
linked_*.ds
59+
unlinked.ds
60+
unlinked_spec.ds
61+
1562
# Android related
1663
**/android/**/gradle-wrapper.jar
1764
**/android/.gradle
@@ -20,16 +67,52 @@ pubspec.lock
2067
**/android/gradlew.bat
2168
**/android/local.properties
2269
**/android/**/GeneratedPluginRegistrant.java
70+
**/android/key.properties
71+
*.jks
2372

73+
# iOS/XCode related
74+
**/ios/**/*.mode1v3
75+
**/ios/**/*.mode2v3
76+
**/ios/**/*.moved-aside
77+
**/ios/**/*.pbxuser
78+
**/ios/**/*.perspectivev3
79+
**/ios/**/*sync/
80+
**/ios/**/.sconsign.dblite
81+
**/ios/**/.tags*
82+
**/ios/**/.vagrant/
83+
**/ios/**/DerivedData/
84+
**/ios/**/Icon?
85+
**/ios/**/Pods/
86+
**/ios/**/.symlinks/
87+
**/ios/**/profile
88+
**/ios/**/xcuserdata
89+
**/ios/.generated/
90+
**/ios/Flutter/.last_build_id
91+
**/ios/Flutter/App.framework
92+
**/ios/Flutter/Flutter.framework
93+
**/ios/Flutter/Flutter.podspec
94+
**/ios/Flutter/Generated.xcconfig
95+
**/ios/Flutter/ephemeral
96+
**/ios/Flutter/app.flx
97+
**/ios/Flutter/app.zip
98+
**/ios/Flutter/flutter_assets/
2499
**/ios/Flutter/flutter_export_environment.sh
100+
**/ios/ServiceDefinitions.json
101+
**/ios/Runner/GeneratedPluginRegistrant.*
25102

26-
build/
27-
.idea
28-
example/ios/Frameworks/
29-
example/lib/ui/
103+
# macOS
104+
**/macos/Flutter/GeneratedPluginRegistrant.swift
30105

31-
example_livelist/lib/application_constants.dart
106+
# Coverage
107+
coverage/
32108

33-
.flutter-plugins-dependencies
109+
# Symbols
110+
app.*.symbols
34111

35-
.vscode/
112+
# Exceptions to above rules.
113+
!**/ios/**/default.mode1v3
114+
!**/ios/**/default.mode2v3
115+
!**/ios/**/default.pbxuser
116+
!**/ios/**/default.perspectivev3
117+
!/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages
118+
!/dev/ci/**/Gemfile.lock

.travis.yml

+4-1
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,13 @@ install:
1111

1212
script:
1313
- (cd packages/dart && pub get)
14+
- (cd packages/dart && dart run build_runner build --delete-conflicting-outputs)
1415
- (cd packages/dart && pub run test)
16+
- (cd packages/flutter && flutter pub remove parse_server_sdk)
17+
- (cd packages/flutter && flutter pub add parse_server_sdk --path ../dart)
1518
- (cd packages/flutter && flutter pub get)
1619
- (cd packages/flutter && flutter test --no-pub test/)
1720

1821
cache:
1922
directories:
20-
- "$HOME/.pub-cache"
23+
- "$HOME/.pub-cache"

packages/dart/CHANGELOG.md

+9
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
## 3.1.0
2+
Bug fixes
3+
General improvements
4+
Updated dependencies
5+
6+
## 3.0.0
7+
Stable null safety release.
8+
19
## 2.1.0
210
Option para uses ParseHTTPClient (default) or ParseDioClient (slow on Flutter Web).
311
**BREAKING CHANGE** if use progress callback at the file upload in version 2.0.1
@@ -6,6 +14,7 @@ Changed to the method POST on Login
614
Bug fixes
715
General improvements
816
Updated dependencies
17+
918
## 2.0.1
1019
Fixed network exceptions. [#482](https://github.com/parse-community/Parse-SDK-Flutter/pull/482)
1120

packages/dart/README.md

+11-7
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,8 @@ This is a Dart package that allows communication with a Parse Server, (https://p
1717
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)
1818

1919
## Getting Started
20-
To install, either add to your pubspec.yaml
21-
```yml
22-
dependencies:
23-
parse_server_sdk: ^2.1.0
24-
```
25-
or clone this repository and add to your project. As this is an early development with multiple contributors, it is probably best to download/clone and keep updating as an when a new feature is added.
2620

21+
To install, either add [dependency in your pubspec.yaml file](https://pub.dev/packages/parse_server_sdk/install).
2722

2823
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...
2924

@@ -66,7 +61,6 @@ When running via express, set [ParseServerOptions](https://parseplatform.org/par
6661

6762
Be aware that for web ParseInstallation does include app name, version or package identifier.
6863

69-
7064
## Objects
7165
You can create custom objects by calling:
7266
```dart
@@ -248,6 +242,15 @@ if (dietPlan.success) {
248242
}
249243
```
250244

245+
### Alternative query methods
246+
247+
The standard query method `query()` returns a `ParseResponse` that contains the result or the error. As an alternative, you can also use `Future<List<T>> find()` for receiving options.
248+
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<List<T>> find()` will return an empty list instead of the 'No results' error you receive in case no object matches you query.
249+
250+
Choosing between `query()` and `find()` comes down to personal preference. Both methods can be used for querying a `ParseQuery`, just the output method differs.
251+
252+
Similar to `find()` the `QueryBuilder` also has a function called `Future<T>? 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`.
253+
251254
## Complex queries
252255
You can create complex queries to really put your database to the test:
253256

@@ -303,6 +306,7 @@ The features available are:-
303306
* WithinKilometers
304307
* WithinRadians
305308
* WithinGeoBox
309+
* WithinPolygon
306310
* MatchesQuery
307311
* DoesNotMatchQuery
308312
* MatchesKeyInQuery

packages/dart/analysis_options.yaml

Whitespace-only changes.

packages/dart/lib/parse_server_sdk.dart

+26-32
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,9 @@ import 'dart:io';
66
import 'dart:math';
77
import 'dart:typed_data';
88

9+
import 'package:dio/dio.dart';
910
import 'package:meta/meta.dart';
1011
import 'package:mime_type/mime_type.dart';
11-
import 'package:parse_server_sdk/src/network/parse_http_client.dart';
12-
import 'package:parse_server_sdk/src/network/parse_websocket.dart'
13-
as parse_web_socket;
1412
import 'package:path/path.dart' as path;
1513
import 'package:sembast/sembast.dart';
1614
import 'package:sembast/sembast_io.dart';
@@ -19,6 +17,9 @@ import 'package:uuid/uuid.dart';
1917
import 'package:web_socket_channel/web_socket_channel.dart';
2018
import 'package:xxtea/xxtea.dart';
2119

20+
import 'src/network/parse_http_client.dart';
21+
import 'src/network/parse_websocket.dart' as parse_web_socket;
22+
2223
export 'src/network/parse_dio_client.dart';
2324
export 'src/network/parse_http_client.dart';
2425

@@ -60,14 +61,12 @@ part 'src/storage/xxtea_codec.dart';
6061
part 'src/utils/parse_date_format.dart';
6162
part 'src/utils/parse_decoder.dart';
6263
part 'src/utils/parse_encoder.dart';
63-
part 'src/utils/parse_file_extensions.dart';
6464
part 'src/utils/parse_live_list.dart';
6565
part 'src/utils/parse_logger.dart';
6666
part 'src/utils/parse_login_helpers.dart';
6767
part 'src/utils/parse_utils.dart';
6868

6969
class Parse {
70-
ParseCoreData data;
7170
bool _hasBeenInitialized = false;
7271

7372
/// To initialize Parse Server in your application
@@ -86,25 +85,25 @@ class Parse {
8685
String appId,
8786
String serverUrl, {
8887
bool debug = false,
89-
String appName,
90-
String appVersion,
91-
String appPackageName,
92-
String locale,
93-
String liveQueryUrl,
94-
String clientKey,
95-
String masterKey,
96-
String sessionId,
88+
String? appName,
89+
String? appVersion,
90+
String? appPackageName,
91+
String? locale,
92+
String? liveQueryUrl,
93+
String? clientKey,
94+
String? masterKey,
95+
String? sessionId,
9796
bool autoSendSessionId = true,
98-
SecurityContext securityContext,
99-
CoreStore coreStore,
100-
Map<String, ParseObjectConstructor> registeredSubClassMap,
101-
ParseUserConstructor parseUserConstructor,
102-
ParseFileConstructor parseFileConstructor,
103-
List<int> liveListRetryIntervals,
104-
ParseConnectivityProvider connectivityProvider,
105-
String fileDirectory,
106-
Stream<void> appResumedStream,
107-
ParseClientCreator clientCreator,
97+
SecurityContext? securityContext,
98+
CoreStore? coreStore,
99+
Map<String, ParseObjectConstructor>? registeredSubClassMap,
100+
ParseUserConstructor? parseUserConstructor,
101+
ParseFileConstructor? parseFileConstructor,
102+
List<int>? liveListRetryIntervals,
103+
ParseConnectivityProvider? connectivityProvider,
104+
String? fileDirectory,
105+
Stream<void>? appResumedStream,
106+
ParseClientCreator? clientCreator,
108107
}) async {
109108
final String url = removeTrailingSlash(serverUrl);
110109

@@ -140,10 +139,8 @@ class Parse {
140139

141140
bool hasParseBeenInitialized() => _hasBeenInitialized;
142141

143-
Future<ParseResponse> healthCheck(
144-
{bool debug, ParseClient client, bool sendSessionIdByDefault}) async {
145-
ParseResponse parseResponse;
146-
142+
Future<ParseResponse > healthCheck(
143+
{bool? debug, ParseClient? client, bool? sendSessionIdByDefault}) async {
147144
final bool _debug = isDebugEnabled(objectLevelDebug: debug);
148145

149146
final ParseClient _client = client ??
@@ -158,12 +155,9 @@ class Parse {
158155
try {
159156
final ParseNetworkResponse response =
160157
await _client.get('${ParseCoreData().serverUrl}$keyEndPointHealth');
161-
parseResponse =
162-
handleResponse<Parse>(null, response, type, _debug, className);
158+
return handleResponse<Parse>(null, response, type, _debug, className);
163159
} on Exception catch (e) {
164-
parseResponse = handleException(e, type, _debug, className);
160+
return handleException(e, type, _debug, className);
165161
}
166-
167-
return parseResponse;
168162
}
169163
}

packages/dart/lib/src/base/parse_constants.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
part of flutter_parse_sdk;
22

33
// Library
4-
const String keySdkVersion = '2.1.0';
4+
const String keySdkVersion = '3.1.0';
55
const String keyLibraryName = 'Flutter Parse SDK';
66

77
// End Points

packages/dart/lib/src/data/app_info.dart

-13
This file was deleted.

0 commit comments

Comments
 (0)