Skip to content

Commit 5a27780

Browse files
committed
Update for 1.0.0
1 parent 0e1916c commit 5a27780

20 files changed

+256
-41
lines changed

CHANGELOG.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,29 @@
1+
## 8.0.0-dev.2 Latest
2+
3+
### NEW
4+
* Support for Appwrite 1.0.0-RC1
5+
* More verbose headers have been included in the Clients - `x-sdk-name`, `x-sdk-platform`, `x-sdk-language`, `x-sdk-version`
6+
* Helper classes and methods for Permissions, Roles and IDs
7+
* Helper methods to suport new queries
8+
* All Dates and times are now returned in the ISO 8601 format
9+
10+
### BREAKING CHANGES
11+
12+
* `databaseId` is no longer part of the `Database` Service constructor. `databaseId` will be part of the respective methods of the database service.
13+
* `color` attribute is no longer supported in the Avatars Service
14+
* The `number` argument in phone endpoints have been renamed to `phone`
15+
* List endpoints no longer support `limit`, `offset`, `cursor`, `cursorDirection`, `orderAttributes`, `orderTypes` as they have been moved to the `queries` array
16+
* `read` and `write` permission have been deprecated and they are now included in the `permissions` array
17+
* Renamed methods of the Query helper
18+
1. `lesser` renamed to `lessThan`
19+
2. `lesserEqual` renamed to `lessThanEqual`
20+
3. `greater` renamed to `greaterThan`
21+
4. `greaterEqual` renamed to `greaterThanEqual`
22+
* `User` response model is now renamed to `Account`
23+
24+
**Full Changelog for Appwrite 1.0.0-RC1 can be found here**:
25+
https://github.com/appwrite/appwrite/blob/master/CHANGES.md
26+
127
## 7.0.0
228
* **BREAKING** Switched to using [flutter_web_auth_2](https://pub.dev/packages/flutter_web_auth_2), check Getting Started section in Readme for changes (Android and Web will require adjustments for OAuth to work properly)
329
* Fixes Concurrent modification issue

README.md

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

33
[![pub package](https://img.shields.io/pub/v/appwrite?style=flat-square)](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-1.0.0-RC1-blue.svg?style=flat-square)
5+
![Version](https://img.shields.io/badge/api%20version-1.0.0-blue.svg?style=flat-square)
66
[![Build Status](https://img.shields.io/travis/com/appwrite/sdk-generator?style=flat-square)](https://travis-ci.com/appwrite/sdk-generator)
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-RC1. 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.0. 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-dev.2
24+
appwrite: ^8.0.0
2525
```
2626
2727
You can install packages from the command line:
@@ -134,9 +134,9 @@ When trying to connect to Appwrite from an emulator or a mobile device, localhos
134134
```dart
135135
// Register User
136136
Account account = Account(client);
137-
Response user = await account
137+
final user = await account
138138
.create(
139-
userId: '[USER_ID]',
139+
userId: ID.unique(),
140140
email: 'me@appwrite.io',
141141
password: 'password',
142142
name: 'My Name'
@@ -162,9 +162,9 @@ void main() {
162162
// Register User
163163
Account account = Account(client);
164164
165-
Response user = await account
165+
final user = await account
166166
.create(
167-
userId: '[USER_ID]',
167+
userId: ID.unique(),
168168
email: 'me@appwrite.io',
169169
password: 'password',
170170
name: 'My Name'
@@ -173,14 +173,14 @@ void main() {
173173
```
174174

175175
### Error Handling
176-
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.
176+
The Appwrite Flutter SDK raises `AppwriteException` object with `message`, `type`, `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.
177177

178178
```dart
179-
Users users = Users(client);
179+
Account account = Account(client);
180180
181181
try {
182-
final response = await users.create(userId: '[USER_ID]', email: ‘email@example.com’,password: ‘password’, name: ‘name’);
183-
print(response.data);
182+
final user = await account.create(userId: ID.unique(), email: ‘email@example.com’,password: ‘password’, name: ‘name’);
183+
print(user.toMap());
184184
} on AppwriteException catch(e) {
185185
//show message to user or do other operation based on error as required
186186
print(e.message);

docs/examples/account/list-logs.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
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.listLogs(
12+
);
13+
14+
result
15+
.then((response) {
16+
print(response);
17+
}).catchError((error) {
18+
print(error.response);
19+
});
20+
}
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.listSessions();
12+
13+
result
14+
.then((response) {
15+
print(response);
16+
}).catchError((error) {
17+
print(error.response);
18+
});
19+
}
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+
Locale locale = Locale(client);
6+
7+
client
8+
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
9+
.setProject('5df5acd0d48c2') // Your project ID
10+
;
11+
Future result = locale.listContinents();
12+
13+
result
14+
.then((response) {
15+
print(response);
16+
}).catchError((error) {
17+
print(error.response);
18+
});
19+
}
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+
Locale locale = Locale(client);
6+
7+
client
8+
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
9+
.setProject('5df5acd0d48c2') // Your project ID
10+
;
11+
Future result = locale.listCountriesEU();
12+
13+
result
14+
.then((response) {
15+
print(response);
16+
}).catchError((error) {
17+
print(error.response);
18+
});
19+
}
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+
Locale locale = Locale(client);
6+
7+
client
8+
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
9+
.setProject('5df5acd0d48c2') // Your project ID
10+
;
11+
Future result = locale.listCountriesPhones();
12+
13+
result
14+
.then((response) {
15+
print(response);
16+
}).catchError((error) {
17+
print(error.response);
18+
});
19+
}
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+
Locale locale = Locale(client);
6+
7+
client
8+
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
9+
.setProject('5df5acd0d48c2') // Your project ID
10+
;
11+
Future result = locale.listCountries();
12+
13+
result
14+
.then((response) {
15+
print(response);
16+
}).catchError((error) {
17+
print(error.response);
18+
});
19+
}
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+
Locale locale = Locale(client);
6+
7+
client
8+
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
9+
.setProject('5df5acd0d48c2') // Your project ID
10+
;
11+
Future result = locale.listCurrencies();
12+
13+
result
14+
.then((response) {
15+
print(response);
16+
}).catchError((error) {
17+
print(error.response);
18+
});
19+
}
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+
Locale locale = Locale(client);
6+
7+
client
8+
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
9+
.setProject('5df5acd0d48c2') // Your project ID
10+
;
11+
Future result = locale.listLanguages();
12+
13+
result
14+
.then((response) {
15+
print(response);
16+
}).catchError((error) {
17+
print(error.response);
18+
});
19+
}

0 commit comments

Comments
 (0)