You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
**This SDK is compatible with Appwrite server version 0.7.x. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-dart/releases).**
9
+
**This SDK is compatible with Appwrite server version 0.8.x. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-dart/releases).**
10
10
11
11
> This is the Dart SDK for integrating with Appwrite from your Dart server-side code. If you're looking for the Flutter SDK you should check [appwrite/sdk-for-flutter](https://github.com/appwrite/sdk-for-flutter)
12
12
@@ -24,7 +24,7 @@ Add this to your package's `pubspec.yaml` file:
24
24
25
25
```yml
26
26
dependencies:
27
-
dart_appwrite: ^0.5.0-dev.1
27
+
dart_appwrite: ^0.6.0
28
28
```
29
29
30
30
You can install packages from the command line:
@@ -47,6 +47,7 @@ void main() async {
47
47
.setEndpoint('http://[HOSTNAME_OR_IP]/v1') // Make sure your endpoint is accessible
48
48
.setProject('5ff3379a01d25') // Your project ID
49
49
.setKey('cd868c7af8bdc893b4...93b7535db89')
50
+
.setSelfSigned() // Use only on dev mode with a self-signed SSL cert
50
51
51
52
Users users = Users(client);
52
53
@@ -59,6 +60,21 @@ void main() async {
59
60
}
60
61
```
61
62
63
+
### Error handling
64
+
The Appwrite Dart SDK raises `AppwriteException` object with `message`, `code` and `response` properties. You can handle any errors by catching `AppwriteException` and present the `message` to the user or handle it yourself based on the provided error information. Below is an example.
65
+
66
+
```dart
67
+
Users users = Users(client);
68
+
69
+
try {
70
+
final response = await users.create(email: ‘[email protected]’,password: ‘password’, name: ‘name’);
71
+
print(response.data);
72
+
} on AppwriteException catch(e) {
73
+
//show message to user or do other operation based on error as required
74
+
print(e.message);
75
+
}
76
+
```
77
+
62
78
### Learn more
63
79
You can use followng resources to learn more and get help
64
80
- 🚀 [Getting Started Tutorial](https://appwrite.io/docs/getting-started-for-server)
0 commit comments