Skip to content

Commit f8480fd

Browse files
Merge pull request #95 from appwrite/dev
chore: update role helper class
2 parents 5a27780 + 3e89df0 commit f8480fd

File tree

6 files changed

+19
-23
lines changed

6 files changed

+19
-23
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
[![Twitter Account](https://img.shields.io/twitter/follow/appwrite?color=00acee&label=twitter&style=flat-square)](https://twitter.com/appwrite)
88
[![Discord](https://img.shields.io/discord/564160730845151244?label=discord&style=flat-square)](https://appwrite.io/discord)
99

10-
**This SDK is compatible with Appwrite server version 1.0.0. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-flutter/releases).**
10+
**This SDK is compatible with Appwrite server version 1.0.x. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-flutter/releases).**
1111

1212
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. Use the Flutter SDK to integrate your app with the Appwrite server to easily start interacting with all of Appwrite backend APIs and tools. For full API documentation and tutorials go to [https://appwrite.io/docs](https://appwrite.io/docs)
1313

@@ -21,7 +21,7 @@ Add this to your package's `pubspec.yaml` file:
2121

2222
```yml
2323
dependencies:
24-
appwrite: ^8.0.0
24+
appwrite: ^8.1.0
2525
```
2626
2727
You can install packages from the command line:
@@ -91,7 +91,7 @@ For web in order to capture the OAuth2 callback URL and send it to the applicati
9191
close the window.
9292
<script>
9393
window.opener.postMessage({
94-
flutter-web-auth2: window.location.href
94+
flutter-web-auth-2: window.location.href
9595
}, window.location.origin);
9696
window.close();
9797
</script>

example/README.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,23 @@
33
Init your Appwrite client:
44

55
```dart
6-
Client client = Client();
7-
8-
client
9-
.setEndpoint('https://localhost/v1') // Your Appwrite Endpoint
10-
.setProject('5e8cf4f46b5e8') // Your project ID
11-
.setSelfSigned() // Remove in production
12-
;
6+
Client client = Client();
137
8+
client
9+
.setEndpoint('https://localhost/v1') // Your Appwrite Endpoint
10+
.setProject('5e8cf4f46b5e8') // Your project ID
11+
.setSelfSigned() // Remove in production
12+
;
1413
```
1514

1615
Create a new user and session:
1716

1817
```dart
1918
Account account = Account(client);
2019
21-
Response user = await account.create(userId: '[USER_ID]', email: 'me@appwrite.io', password: 'password', name: 'My Name');
20+
final user = await account.create(userId: '[USER_ID]', email: 'me@appwrite.io', password: 'password', name: 'My Name');
2221
23-
Response session = await account.createSession(email: 'me@appwrite.io', password: 'password');
22+
final session = await account.createEmailSession(email: 'me@appwrite.io', password: 'password');
2423
2524
```
2625

@@ -29,7 +28,7 @@ Fetch user profile:
2928
```dart
3029
Account account = Account(client);
3130
32-
Response profile = await account.get();
31+
final profile = await account.get();
3332
```
3433

3534
Upload File:
@@ -40,7 +39,7 @@ Storage storage = Storage(client);
4039
late InputFile file;
4140
4241
if(kIsWeb) {
43-
file = InputFile(file: await MultipartFile.fromFile('file', './path-to-file/image.jpg', filename: 'image.jpg'));
42+
file = InputFile(bytes: pickedFile.bytes, filename: 'image.jpg');
4443
} else {
4544
file = InputFile(path: './path-to-file/image.jpg', filename: 'image.jpg');
4645
}
@@ -49,8 +48,9 @@ storage.createFile(
4948
bucketId: '[BUCKET_ID]',
5049
fileId: '[FILE_ID]', // use 'unique()' to automatically generate a unique ID
5150
file: file,
52-
read: ['role:all'],
53-
write: []
51+
permissions: [
52+
Permission.read(Role.any()),
53+
],
5454
)
5555
.then((response) {
5656
print(response); // File uploaded!

lib/role.dart

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,4 @@ class Role {
3333
static String member(String id) {
3434
return 'member:$id';
3535
}
36-
37-
static String status(String status) {
38-
return 'status:$status';
39-
}
4036
}

lib/src/client_browser.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ class ClientBrowser extends ClientBase with ClientMixin {
4343
'x-sdk-name': 'Flutter',
4444
'x-sdk-platform': 'client',
4545
'x-sdk-language': 'flutter',
46-
'x-sdk-version': '8.0.0',
46+
'x-sdk-version': '8.1.0',
4747
'X-Appwrite-Response-Format' : '1.0.0',
4848
};
4949

lib/src/client_io.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ class ClientIO extends ClientBase with ClientMixin {
6464
'x-sdk-name': 'Flutter',
6565
'x-sdk-platform': 'client',
6666
'x-sdk-language': 'flutter',
67-
'x-sdk-version': '8.0.0',
67+
'x-sdk-version': '8.1.0',
6868
'X-Appwrite-Response-Format' : '1.0.0',
6969
};
7070

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: appwrite
2-
version: 8.0.0
2+
version: 8.1.0
33
description: Appwrite is an open-source self-hosted backend server that abstract and simplify complex and repetitive development tasks behind a very simple REST API
44
homepage: https://appwrite.io
55
repository: https://github.com/appwrite/sdk-for-flutter

0 commit comments

Comments
 (0)