Skip to content

Commit c5f5cd9

Browse files
committed
Upgraded to support Appwrite 0.8
1 parent b7d88ee commit c5f5cd9

Some content is hidden

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

68 files changed

+307
-40
lines changed

CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1+
## 0.6.0
2+
3+
- Upgraded to Null-safety, minimum Dart SDK required 2.12.0
4+
- Upgraded all underlying dependencies to null safe version
5+
- BREAKING Renamed parameter inviteId to membershipId on teams.updateMembershipStatus, teams.deleteMembership
6+
- [Anonymous login](https://appwrite.io/docs/client/account?sdk=flutter#accountCreateAnonymousSession)
7+
- [JWT Support](https://appwrite.io/docs/client/account?sdk=flutter#accountCreateJWT)
8+
- Fallback Cookies for Flutter Web if 3rd party cookies are blocked
9+
- Custom User Agent Support
10+
- [Update membership roles](https://appwrite.io/docs/client/teams?sdk=flutter#teamsUpdateMembershipRoles)
11+
- New awesome image preview features, supports borderRadius, borderColor, borderWidth
12+
113
## 0.5.0-dev.1
214

315
- Upgraded to Null-safety, minimum Dart SDK required 2.12.0 and minimum Flutter SDK version required 2.0.0

README.md

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22

33
[![pub package](https://img.shields.io/pub/v/appwrite?style=flat-square.svg)](https://pub.dartlang.org/packages/appwrite)
44
![License](https://img.shields.io/github/license/appwrite/sdk-for-flutter.svg?style=flat-square)
5-
![Version](https://img.shields.io/badge/api%20version-0.7.0-blue.svg?style=flat-square)
5+
![Version](https://img.shields.io/badge/api%20version-0.8.0-blue.svg?style=flat-square)
66
[![Twitter Account](https://img.shields.io/twitter/follow/appwrite_io?color=00acee&label=twitter&style=flat-square)](https://twitter.com/appwrite_io)
77
[![Discord](https://img.shields.io/discord/564160730845151244?label=discord&style=flat-square)](https://appwrite.io/discord)
88

9-
**This SDK is compatible with Appwrite server version 0.7.x. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-flutter/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-flutter/releases).**
1010

1111
Appwrite is an open-source backend as a service server that abstract and simplify complex and repetitive development tasks behind a very simple to use REST API. Appwrite aims to help you develop your apps faster and in a more secure way.
1212
Use the Flutter SDK to integrate your app with the Appwrite server to easily start interacting with all of Appwrite backend APIs and tools.
@@ -22,7 +22,7 @@ Add this to your package's `pubspec.yaml` file:
2222

2323
```yml
2424
dependencies:
25-
appwrite: ^0.5.0-dev.1
25+
appwrite: ^0.6.0
2626
```
2727
2828
You can install packages from the command line:
@@ -92,7 +92,7 @@ Client client = Client();
9292
client
9393
.setEndpoint('https://localhost/v1') // Your Appwrite Endpoint
9494
.setProject('5e8cf4f46b5e8') // Your project ID
95-
.setSelfSigned() // Remove in production
95+
.setSelfSigned() // Use only on dev mode with a self-signed SSL cert
9696
;
9797
```
9898

@@ -125,7 +125,7 @@ Client client = Client();
125125
client
126126
.setEndpoint('https://localhost/v1') // Your Appwrite Endpoint
127127
.setProject('5e8cf4f46b5e8') // Your project ID
128-
.setSelfSigned() // Remove in production
128+
.setSelfSigned() // Use only on dev mode with a self-signed SSL cert
129129
;
130130
131131
@@ -140,6 +140,21 @@ Response user = await account
140140
);
141141
```
142142

143+
### Error Handling
144+
The Appwrite Flutter 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.
145+
146+
```dart
147+
Users users = Users(client);
148+
149+
try {
150+
final response = await users.create(email: ‘email@example.com’,password: ‘password’, name: ‘name’);
151+
print(response.data);
152+
} on AppwriteException catch(e) {
153+
//show message to user or do other operation based on error as required
154+
print(e.message);
155+
}
156+
```
157+
143158
### Learn more
144159
You can use followng resources to learn more and get help
145160
- 🚀 [Getting Started Tutorial](https://appwrite.io/docs/getting-started-for-flutter)
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import 'package:appwrite/appwrite.dart';
2+
3+
void main() { // Init SDK
4+
Client client = Client();
5+
Account account = Account(client);
6+
7+
client
8+
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
9+
.setProject('5df5acd0d48c2') // Your project ID
10+
;
11+
Future result = account.createAnonymousSession();
12+
13+
result
14+
.then((response) {
15+
print(response);
16+
}).catchError((error) {
17+
print(error.response);
18+
});
19+
}

docs/examples/account/create-j-w-t.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import 'package:appwrite/appwrite.dart';
2+
3+
void main() { // Init SDK
4+
Client client = Client();
5+
Account account = Account(client);
6+
7+
client
8+
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
9+
.setProject('5df5acd0d48c2') // Your project ID
10+
;
11+
Future result = account.createJWT();
12+
13+
result
14+
.then((response) {
15+
print(response);
16+
}).catchError((error) {
17+
print(error.response);
18+
});
19+
}

docs/examples/account/create-recovery.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ void main() { // Init SDK
77
client
88
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
99
.setProject('5df5acd0d48c2') // Your project ID
10+
.setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token
1011
;
1112
Future result = account.createRecovery(
1213
email: 'email@example.com',

docs/examples/account/create-verification.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ void main() { // Init SDK
77
client
88
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
99
.setProject('5df5acd0d48c2') // Your project ID
10+
.setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token
1011
;
1112
Future result = account.createVerification(
1213
url: 'https://example.com',

docs/examples/account/delete-session.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ void main() { // Init SDK
77
client
88
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
99
.setProject('5df5acd0d48c2') // Your project ID
10+
.setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token
1011
;
1112
Future result = account.deleteSession(
1213
sessionId: '[SESSION_ID]',

docs/examples/account/delete-sessions.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ void main() { // Init SDK
77
client
88
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
99
.setProject('5df5acd0d48c2') // Your project ID
10+
.setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token
1011
;
1112
Future result = account.deleteSessions();
1213

docs/examples/account/delete.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ void main() { // Init SDK
77
client
88
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
99
.setProject('5df5acd0d48c2') // Your project ID
10+
.setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token
1011
;
1112
Future result = account.delete();
1213

docs/examples/account/get-logs.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ void main() { // Init SDK
77
client
88
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
99
.setProject('5df5acd0d48c2') // Your project ID
10+
.setJWT('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ...') // Your secret JSON Web Token
1011
;
1112
Future result = account.getLogs();
1213

0 commit comments

Comments
 (0)