Skip to content

Commit 7608870

Browse files
authored
feat: Update Dart, Flutter API links and improve document structure (#931)
1 parent 342a2da commit 7608870

22 files changed

+146
-18
lines changed

Diff for: _config.yml

+3-2
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,11 @@ support_url: https://community.parseplatform.org
2020
apis:
2121
osx: https://parseplatform.org/Parse-SDK-iOS-OSX/api/
2222
android: https://parseplatform.org/Parse-SDK-Android/api/
23-
js: https://parseplatform.org/Parse-SDK-JS/api/master/
23+
js: https://parseplatform.org/Parse-SDK-JS/api/
2424
php: https://parseplatform.org/parse-php-sdk/
2525
dotnet: https://parseplatform.org/Parse-SDK-dotNET/api/
26-
flutter: flutter/api/
26+
flutter: https://parseplatform.org/Parse-SDK-Flutter/flutter/flutter_parse_sdk_flutter/flutter_parse_sdk_flutter-library.html
27+
dart: https://parseplatform.org/Parse-SDK-Flutter/dart/flutter_parse_sdk/flutter_parse_sdk-library.html
2728
parse-server: https://parseplatform.org/parse-server/api/
2829

2930
# Build settings
File renamed without changes.
File renamed without changes.
File renamed without changes.

Diff for: _includes/dart/getting-started.md

+73
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
# Getting Started
2+
3+
- To install the Parse Dart SDK add it to your app as a dependency via the [pub.dev](https://pub.dev/packages/parse_server_sdk/install) registry.
4+
5+
Once you have the SDK added as a dependency, initialize the SDK as early as possible in your application (e.g. in your application class) like this:
6+
7+
```dart
8+
await Parse().initialize(
9+
keyApplicationId,
10+
keyParseServerUrl,
11+
);
12+
```
13+
14+
If you want to use secure storage or use the Flutter web/desktop SDK, please change to the below instance of `CoreStorage` as it has no dependencies on Flutter. `CoreStoreSembastImp` does not encrypt the data on the web and Web is not safe anyway. Encrypt fields manually as needed.
15+
16+
```dart
17+
await Parse().initialize(
18+
keyParseApplicationId,
19+
keyParseServerUrl,
20+
coreStore: await CoreStoreSembastImp.getInstance("/data"));
21+
```
22+
23+
It's possible to add other parameters to work with your instance of Parse Server:
24+
25+
```dart
26+
await Parse().initialize(
27+
keyApplicationId,
28+
keyParseServerUrl,
29+
clientKey: keyParseClientKey, // Required for some setups
30+
debug: true, // When enabled, prints logs to console
31+
liveQueryUrl: keyLiveQueryUrl, // Required if using LiveQuery
32+
autoSendSessionId: true, // Required for authentication and ACL
33+
securityContext: securityContext, // Again, required for some setups
34+
coreStore: CoreStoreMemoryImp()); // Non persistent mode (default): Sdk will store everything in memory instead of using Sembast as an internal DB.
35+
```
36+
37+
⚠️ The master key should only be used in safe environments and never on client side. Using this package on a server should be fine.
38+
39+
## Early Web Support
40+
41+
Due to Cross-Origin Resource Sharing (CORS) restrictions, web support requires adding `X-Parse-Installation-Id` as an allowed header in the Parse Server configuration:
42+
43+
- When running directly via docker, set the env var `PARSE_SERVER_ALLOW_HEADERS=X-Parse-Installation-Id`.
44+
- When running via express, set the [Parse Server option](https://parseplatform.org/parse-server/api/master/ParseServerOptions.html) `allowHeaders: ['X-Parse-Installation-Id']`.
45+
46+
## Desktop Support (macOS)
47+
48+
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 code:
49+
50+
```swift
51+
<key>com.apple.security.network.client</key>
52+
<true/>
53+
```
54+
55+
to the following files:
56+
57+
```
58+
/macOS/Runner/Release.entitlements
59+
/macOS/Runner/DebugProfile.entitlements
60+
```
61+
62+
## Network client
63+
64+
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.
65+
66+
If you want to use the `ParseDioClient`, which uses the dio network library, you can provide a custom `ParseClientCreator` at the initialization of the SDK:
67+
68+
```dart
69+
await Parse().initialize(
70+
//...
71+
clientCreator: ({bool? sendSessionId, SecurityContext? securityContext}) => ParseDioClient(sendSessionId: sendSessionId, securityContext: securityContext),
72+
);
73+
```
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

Diff for: _includes/flutter/getting-started.md

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# Getting Started
22

3-
- To install the Parse Dart SDK add it to your app as a dependency via the [pub.dev](https://pub.dev/packages/parse_server_sdk/install) registry.
43
- To install the Parse Flutter SDK add it to your app as a dependency via the [pub.dev](https://pub.dev/packages/parse_server_sdk_flutter/install) registry.
54

65
Once you have the SDK added as a dependency, initialize the SDK as early as possible in your application (e.g. in your application class) like this:

Diff for: assets/symbols.svg

+4-4
Loading

Diff for: css/lib/docs/components/_docs-platform.scss

+5
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,11 @@
185185
width: 23px;
186186
height: 24px;
187187
}
188+
svg.icon-dart{
189+
fill: $dartPlatform;
190+
width: 23px;
191+
height: 24px;
192+
}
188193
svg.icon-js{
189194
fill: $jsPlatform;
190195
width: 33px;

Diff for: css/lib/docs/components/_docsearch.scss

+3
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,9 @@ input {
7575
&.flutter_docs_header{
7676
background-color: $flutterPlatform;
7777
}
78+
&.dart_docs_header{
79+
background-color: $dartPlatform;
80+
}
7881
&.php_docs_docsearch{
7982
background-color: $phpPlatform;
8083
}

Diff for: css/lib/marketing/components/_herosDocs.scss

+3
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@
3434
&.flutter_docs_header{
3535
background-color: $flutterPlatform;
3636
}
37+
&.dart_docs_header{
38+
background-color: $dartPlatform;
39+
}
3740
&.php_docs_header{
3841
background-color: $phpPlatform;
3942
}

Diff for: css/lib/multisite/_variables.scss

+1
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ $osxPlatform: #9CAFBA;
9797
$androidPlatform: #00C26E;
9898
$jsPlatform: #F5A623;
9999
$flutterPlatform: #47c5fb;
100+
$dartPlatform: #227ee6;
100101
$dotnetPlatform: #922ADD;
101102
$unityPlatform: #11A4BA;
102103
$phpPlatform: #0E69A1;

Diff for: dart-api.md

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
layout: redirected
3+
sitemap: false
4+
permalink: /dart/api/
5+
redirect_to:
6+
- https://parseplatform.org/Parse-SDK-Flutter/dart/flutter_parse_sdk/flutter_parse_sdk-library.html
7+
---

Diff for: dart.md

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
title: Dart Guide | Parse
3+
permalink: /dart/guide/
4+
layout: guide
5+
platform: dart
6+
language: dart
7+
display_platform: Dart
8+
api_reference: /dart/api
9+
10+
sections:
11+
- "dart/getting-started.md"
12+
- "dart/objects.md"
13+
- "dart/queries.md"
14+
- "dart/cloud-code.md"
15+
- "dart/config.md"
16+
- "dart/files.md"
17+
- "dart/other-features.md"
18+
- "dart/storage.md"
19+
- "dart/users.md"
20+
21+
---

Diff for: flutter-api.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ layout: redirected
33
sitemap: false
44
permalink: /flutter/api/
55
redirect_to:
6-
- https://pub.dev/documentation/parse_server_sdk_flutter/latest/
7-
---
6+
- https://parseplatform.org/Parse-SDK-Flutter/flutter/flutter_parse_sdk_flutter/flutter_parse_sdk_flutter-library.html
7+
---

Diff for: flutter.md

+9-9
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,18 @@ layout: guide
55
platform: flutter
66
language: dart
77
display_platform: Flutter
8-
api_reference: https://parse-community.github.io/Parse-SDK-Flutter/api
8+
api_reference: /flutter/api
99

1010
sections:
1111
- "flutter/getting-started.md"
12-
- "flutter/objects.md"
13-
- "flutter/queries.md"
14-
- "flutter/cloud-code.md"
15-
- "flutter/config.md"
16-
- "flutter/files.md"
12+
- "dart/objects.md"
13+
- "dart/queries.md"
14+
- "dart/cloud-code.md"
15+
- "dart/config.md"
16+
- "dart/files.md"
1717
- "flutter/push-notifications.md"
18-
- "flutter/other-features.md"
19-
- "flutter/storage.md"
20-
- "flutter/users.md"
18+
- "dart/other-features.md"
19+
- "dart/storage.md"
20+
- "dart/users.md"
2121

2222
---

Diff for: img/dart.svg

+1
Loading

Diff for: index.md

+14
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,20 @@ layout: docs
7979
</footer>
8080
</div>
8181

82+
<div class="docs-platform">
83+
<header class="docs-platform__header">
84+
<span class="docs-platform__name">Dart</span>
85+
<svg class="icon icon-dart"><use xlink:href="{{ site.baseurl }}/assets/symbols.svg#dart"></use></svg>
86+
</header>
87+
<ul class="docs-platform__links">
88+
<li class="docs-platform__links"><a href="dart/guide/">Guide</a></li>
89+
<li class="docs-platform__links"><a href="{{ site.apis.dart }}">API Reference</a></li>
90+
</ul>
91+
<footer class="docs-platform__footer">
92+
<a href="https://github.com/parse-community/Parse-SDK-Flutter/releases/latest" class="btn btn--outline">Latest Downloads</a>
93+
</footer>
94+
</div>
95+
8296
<div class="docs-platform">
8397
<header class="docs-platform__header">
8498
<span class="docs-platform__name">JavaScript</span>

0 commit comments

Comments
 (0)