Skip to content

Commit 2f1f7c3

Browse files
feat: introduce 0.15.x support
1 parent 1e8c379 commit 2f1f7c3

37 files changed

+1182
-419
lines changed

CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
## 6.0.0
2+
* Support for Appwrite 0.15
3+
* **NEW** Phone authentication `account.createPhoneSession()`
4+
* **BREAKING** `Database` -> `Databases`
5+
* **BREAKING** `account.createSession()` -> `account.createEmailSession()`
6+
* **BREAKING** `dateCreated` attribute removed from `Team`, `Execution`, `File` models
7+
* **BREAKING** `dateCreated` and `dateUpdated` attribute removed from `Func`, `Deployment`, `Bucket` models
8+
* **BREAKING** Realtime channels
9+
* collections.[COLLECTION_ID] is now databases.[DATABASE_ID].ollections.[COLLECTION_ID]
10+
* collections.[COLLECTION_ID].documents is now databases.[DATABASE_ID].ollections.[COLLECTION_ID].documents
11+
12+
**Full Changelog for Appwrite 0.15 can be found here**: https://github.com/appwrite/appwrite/blob/master/CHANGES.md#version-0150
13+
114
## 5.0.0
215
* Support for Appwrite 0.14
316
* **BREAKING** `account.delete()` -> `account.updateStatus()`

README.md

Lines changed: 9 additions & 6 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-0.14.0-blue.svg?style=flat-square)
5+
![Version](https://img.shields.io/badge/api%20version-0.15.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 0.14.x. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-flutter/releases).**
10+
**This SDK is compatible with Appwrite server version 0.15.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: ^5.0.0
24+
appwrite: ^6.0.0
2525
```
2626
2727
You can install packages from the command line:
@@ -43,11 +43,14 @@ If you are building your Flutter application for multiple devices, you have to f
4343
### Android
4444
For **Android** first add your app <u>name</u> and <u>package name</u>, Your package name is generally the **applicationId** in your app-level <a href="https://github.com/appwrite/playground-for-flutter/blob/0fdbdff98384fff940ed0b1e08cf14cfe3a2be3e/android/app/build.gradle#L41" target="_blank" rel="noopener">build.gradle</a> file. By registering your new app platform, you are allowing your app to communicate with the Appwrite API.
4545

46-
In order to capture the Appwrite OAuth callback url, the following activity needs to be added to your [AndroidManifest.xml](https://github.com/appwrite/playground-for-flutter/blob/master/android/app/src/main/AndroidManifest.xml). Be sure to replace the **[PROJECT_ID]** string with your actual Appwrite project ID. You can find your Appwrite project ID in your project settings screen in the console.
46+
In order to capture the Appwrite OAuth callback url, the following activity needs to be added inside the `<application>` tag, along side the existing `<activity>` tags in your [AndroidManifest.xml](https://github.com/appwrite/playground-for-flutter/blob/master/android/app/src/main/AndroidManifest.xml). Be sure to replace the **[PROJECT_ID]** string with your actual Appwrite project ID. You can find your Appwrite project ID in your project settings screen in the console.
4747

4848
```xml
49-
<manifest>
50-
<application>
49+
<manifest ...>
50+
....
51+
<application ...>
52+
....
53+
<!-- Add this inside the <application> tag, along side the existing <activity> tags -->
5154
<activity android:name="com.linusu.flutter_web_auth.CallbackActivity" >
5255
<intent-filter android:label="flutter_web_auth">
5356
<action android:name="android.intent.action.VIEW" />

docs/examples/account/create-session.md renamed to docs/examples/account/create-email-session.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ void main() { // Init SDK
88
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
99
.setProject('5df5acd0d48c2') // Your project ID
1010
;
11-
Future result = account.createSession(
11+
Future result = account.createEmailSession(
1212
email: 'email@example.com',
1313
password: 'password',
1414
);
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
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.createPhoneSession(
12+
userId: '[USER_ID]',
13+
number: '',
14+
);
15+
16+
result
17+
.then((response) {
18+
print(response);
19+
}).catchError((error) {
20+
print(error.response);
21+
});
22+
}
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.createPhoneVerification();
12+
13+
result
14+
.then((response) {
15+
print(response);
16+
}).catchError((error) {
17+
print(error.response);
18+
});
19+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
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.updatePhoneSession(
12+
userId: '[USER_ID]',
13+
secret: '[SECRET]',
14+
);
15+
16+
result
17+
.then((response) {
18+
print(response);
19+
}).catchError((error) {
20+
print(error.response);
21+
});
22+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
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.updatePhoneVerification(
12+
userId: '[USER_ID]',
13+
secret: '[SECRET]',
14+
);
15+
16+
result
17+
.then((response) {
18+
print(response);
19+
}).catchError((error) {
20+
print(error.response);
21+
});
22+
}

docs/examples/account/update-phone.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
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.updatePhone(
12+
number: '',
13+
password: 'password',
14+
);
15+
16+
result
17+
.then((response) {
18+
print(response);
19+
}).catchError((error) {
20+
print(error.response);
21+
});
22+
}

docs/examples/database/create-document.md renamed to docs/examples/databases/create-document.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@ import 'package:appwrite/appwrite.dart';
22

33
void main() { // Init SDK
44
Client client = Client();
5-
Database database = Database(client);
5+
Databases databases = Databases(client, databaseId: '[DATABASE_ID]');
66

77
client
88
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
99
.setProject('5df5acd0d48c2') // Your project ID
1010
;
11-
Future result = database.createDocument(
11+
Future result = databases.createDocument(
1212
collectionId: '[COLLECTION_ID]',
1313
documentId: '[DOCUMENT_ID]',
1414
data: {},

docs/examples/database/delete-document.md renamed to docs/examples/databases/delete-document.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@ import 'package:appwrite/appwrite.dart';
22

33
void main() { // Init SDK
44
Client client = Client();
5-
Database database = Database(client);
5+
Databases databases = Databases(client, databaseId: '[DATABASE_ID]');
66

77
client
88
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
99
.setProject('5df5acd0d48c2') // Your project ID
1010
;
11-
Future result = database.deleteDocument(
11+
Future result = databases.deleteDocument(
1212
collectionId: '[COLLECTION_ID]',
1313
documentId: '[DOCUMENT_ID]',
1414
);

0 commit comments

Comments
 (0)