Skip to content

Commit 54f30fa

Browse files
Merge pull request #139 from appwrite/dev
update to appwrite 1.3.0
2 parents 811bd17 + cb9894e commit 54f30fa

26 files changed

+454
-85
lines changed

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
## 9.0.0
2+
3+
* Added relationships support
4+
* Added support for new queries: `isNull`, `isNotNull`, `startsWith`, `notStartsWith`, `endsWith`, `between` and `select`.
5+
* Added update attribute support
6+
* Added team prefs support
7+
* Changed function create/update `execute` parameter to optional
8+
* Changed team `update` to `updateName`
9+
* Changed `Account` service to use the `User` model instead of `Account`
10+
111
## 8.3.0
212

313
* Fix: back navigation bringing back web browser after OAuth session creation

README.md

Lines changed: 5 additions & 5 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.2.1-blue.svg?style=flat-square)
5+
![Version](https://img.shields.io/badge/api%20version-1.3.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.2.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 1.3.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,13 +21,13 @@ Add this to your package's `pubspec.yaml` file:
2121

2222
```yml
2323
dependencies:
24-
appwrite: ^8.3.0
24+
appwrite: ^9.0.0
2525
```
2626
2727
You can install packages from the command line:
2828
2929
```bash
30-
pub get appwrite
30+
flutter pub add appwrite
3131
```
3232

3333

@@ -51,7 +51,7 @@ In order to capture the Appwrite OAuth callback url, the following activity need
5151
<application ...>
5252
....
5353
<!-- Add this inside the <application> tag, along side the existing <activity> tags -->
54-
<activity android:name="com.linusu.flutter_web_auth_2.CallbackActivity" >
54+
<activity android:exported="true" android:name="com.linusu.flutter_web_auth_2.CallbackActivity" >
5555
<intent-filter android:label="flutter_web_auth_2">
5656
<action android:name="android.intent.action.VIEW" />
5757
<category android:name="android.intent.category.DEFAULT" />

docs/examples/account/create.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ void main() { // Init SDK
1111
Future result = account.create(
1212
userId: '[USER_ID]',
1313
14-
password: 'password',
14+
password: '',
1515
);
1616

1717
result

docs/examples/account/update-password.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ void main() { // Init SDK
99
.setProject('5df5acd0d48c2') // Your project ID
1010
;
1111
Future result = account.updatePassword(
12-
password: 'password',
12+
password: '',
1313
);
1414

1515
result

docs/examples/teams/create-membership.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ void main() { // Init SDK
1010
;
1111
Future result = teams.createMembership(
1212
teamId: '[TEAM_ID]',
13-
1413
roles: [],
1514
url: 'https://example.com',
1615
);

docs/examples/teams/get-prefs.md

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

docs/examples/teams/update.md renamed to docs/examples/teams/update-name.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 = teams.update(
11+
Future result = teams.updateName(
1212
teamId: '[TEAM_ID]',
1313
name: '[NAME]',
1414
);

docs/examples/teams/update-prefs.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+
Teams teams = Teams(client);
6+
7+
client
8+
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
9+
.setProject('5df5acd0d48c2') // Your project ID
10+
;
11+
Future result = teams.updatePrefs(
12+
teamId: '[TEAM_ID]',
13+
prefs: {},
14+
);
15+
16+
result
17+
.then((response) {
18+
print(response);
19+
}).catchError((error) {
20+
print(error.response);
21+
});
22+
}

lib/models.dart

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,14 @@ part 'src/models/currency_list.dart';
1515
part 'src/models/phone_list.dart';
1616
part 'src/models/document.dart';
1717
part 'src/models/log.dart';
18-
part 'src/models/account.dart';
18+
part 'src/models/user.dart';
19+
part 'src/models/algo_md5.dart';
20+
part 'src/models/algo_sha.dart';
21+
part 'src/models/algo_phpass.dart';
22+
part 'src/models/algo_bcrypt.dart';
23+
part 'src/models/algo_scrypt.dart';
24+
part 'src/models/algo_scrypt_modified.dart';
25+
part 'src/models/algo_argon2.dart';
1926
part 'src/models/preferences.dart';
2027
part 'src/models/session.dart';
2128
part 'src/models/token.dart';

lib/query.dart

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,27 +3,42 @@ part of appwrite;
33
class Query {
44
Query._();
55

6-
static equal(String attribute, dynamic value) =>
6+
static String equal(String attribute, dynamic value) =>
77
_addQuery(attribute, 'equal', value);
88

9-
static notEqual(String attribute, dynamic value) =>
9+
static String notEqual(String attribute, dynamic value) =>
1010
_addQuery(attribute, 'notEqual', value);
1111

12-
static lessThan(String attribute, dynamic value) =>
12+
static String lessThan(String attribute, dynamic value) =>
1313
_addQuery(attribute, 'lessThan', value);
1414

15-
static lessThanEqual(String attribute, dynamic value) =>
15+
static String lessThanEqual(String attribute, dynamic value) =>
1616
_addQuery(attribute, 'lessThanEqual', value);
1717

18-
static greaterThan(String attribute, dynamic value) =>
18+
static String greaterThan(String attribute, dynamic value) =>
1919
_addQuery(attribute, 'greaterThan', value);
2020

21-
static greaterThanEqual(String attribute, dynamic value) =>
21+
static String greaterThanEqual(String attribute, dynamic value) =>
2222
_addQuery(attribute, 'greaterThanEqual', value);
2323

24-
static search(String attribute, String value) =>
24+
static String search(String attribute, String value) =>
2525
_addQuery(attribute, 'search', value);
2626

27+
static String isNull(String attribute) => 'isNull("$attribute")';
28+
29+
static String isNotNull(String attribute) => 'isNotNull("$attribute")';
30+
31+
static String between(String attribute, dynamic start, dynamic end) =>
32+
_addQuery(attribute, 'between', [start, end]);
33+
34+
static String startsWith(String attribute, String value) =>
35+
_addQuery(attribute, 'startsWith', value);
36+
37+
static String endsWith(String attribute, String value) =>
38+
_addQuery(attribute, 'endsWith', value);
39+
40+
static String select(List<String> attributes) => 'select([${attributes.map((attr) => "\"$attr\"").join(",")}])';
41+
2742
static String orderAsc(String attribute) => 'orderAsc("$attribute")';
2843

2944
static String orderDesc(String attribute) => 'orderDesc("$attribute")';

0 commit comments

Comments
 (0)