Skip to content

Commit e7ec446

Browse files
Merge pull request #30 from appwrite/dev
chore: update role helper class
2 parents 0041c71 + d755546 commit e7ec446

File tree

6 files changed

+16
-21
lines changed

6 files changed

+16
-21
lines changed

README.md

+2-2
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-dart/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-dart/releases).**
1111

1212
> 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)
1313
@@ -23,7 +23,7 @@ Add this to your package's `pubspec.yaml` file:
2323

2424
```yml
2525
dependencies:
26-
dart_appwrite: ^7.0.0
26+
dart_appwrite: ^7.1.0
2727
```
2828
2929
You can install packages from the command line:

example/README.md

+11-12
Original file line numberDiff line numberDiff line change
@@ -3,35 +3,33 @@
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:
1716

1817
```dart
1918
Users users = Users(client);
2019
21-
Response result = await users.create(
20+
User result = await users.create(
2221
userId: '[USER_ID]',
2322
2423
password: 'password',
2524
);
26-
2725
```
2826

2927
Fetch user profile:
3028

3129
```dart
3230
Users users = Users(client);
3331
34-
Response profile = await users.get(
32+
User profile = await users.get(
3533
userId: '[USER_ID]',
3634
);
3735
```
@@ -47,8 +45,9 @@ storage.createFile(
4745
bucketId: '[BUCKET_ID]',
4846
fileId: '[FILE_ID]', // use 'unique()' to automatically generate a unique ID
4947
file: file,
50-
read: ['role:all'],
51-
write: []
48+
permissions: [
49+
Permission.read(Role.any()),
50+
],
5251
)
5352
.then((response) {
5453
print(response); // File uploaded!

lib/role.dart

-4
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

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class ClientBrowser extends ClientBase with ClientMixin {
3333
'x-sdk-name': 'Dart',
3434
'x-sdk-platform': 'server',
3535
'x-sdk-language': 'dart',
36-
'x-sdk-version': '7.0.0',
36+
'x-sdk-version': '7.1.0',
3737
'X-Appwrite-Response-Format' : '1.0.0',
3838
};
3939

lib/src/client_io.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class ClientIO extends ClientBase with ClientMixin {
4242
'x-sdk-name': 'Dart',
4343
'x-sdk-platform': 'server',
4444
'x-sdk-language': 'dart',
45-
'x-sdk-version': '7.0.0',
45+
'x-sdk-version': '7.1.0',
4646
'X-Appwrite-Response-Format' : '1.0.0',
4747
};
4848

pubspec.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: dart_appwrite
2-
version: 7.0.0
2+
version: 7.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-dart

0 commit comments

Comments
 (0)