Skip to content

Commit d1e9a39

Browse files
authored
Merge pull request #263 from appwrite/dev
Add 1.8.x support
2 parents fff40ce + ac38bb8 commit d1e9a39

File tree

125 files changed

+1859
-498
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

125 files changed

+1859
-498
lines changed

.github/workflows/test.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: Analyze and test
2+
3+
on: pull_request
4+
5+
jobs:
6+
test:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v3
10+
- name: Install Flutter
11+
uses: subosito/flutter-action@v2
12+
with:
13+
channel: stable
14+
- run: flutter pub get
15+
- run: flutter analyze --no-fatal-infos --no-fatal-warnings
16+
- run: flutter test

CHANGELOG.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,26 @@
11
# Change Log
22

3+
## 18.0.0
4+
5+
* Support for Appwrite 1.8
6+
* Added TablesDB service
7+
* Added new query types:
8+
* `notContains`
9+
* `notSearch`
10+
* `notBetween`
11+
* `notStartsWith`
12+
* `notEndsWith`
13+
* `createdBefore`
14+
* `createdAfter`
15+
* `updatedBefore`
16+
* `updatedAfter`
17+
* Deprecated `updateMagicURLSession`
18+
* Deprecated `updatePhoneSession`
19+
* Deprecated Databases service
20+
> The TablesDB service is the new recommended way to work with databases.
21+
> Existing databases/collections/attributes/documents can be managed using the TablesDB service.
22+
> Existing Databases service will continue to work, but new features may only be added to the TablesDB service.
23+
324
## 17.1.0
425

526
* Add `incrementDocumentAttribute` and `decrementDocumentAttribute` support to `Databases` service

README.md

Lines changed: 27 additions & 51 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.7.x-blue.svg?style=flat-square)
5+
![Version](https://img.shields.io/badge/api%20version-1.8.x-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.7.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.8.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: ^17.1.0
24+
appwrite: ^18.0.0
2525
```
2626
2727
You can install packages from the command line:
@@ -50,7 +50,7 @@ In order to capture the Appwrite OAuth callback url, the following activity need
5050
....
5151
<application ...>
5252
....
53-
<!-- Add this inside the <application> tag, along side the existing <activity> tags -->
53+
<!-- Add this inside the <application> tag, alongside the existing <activity> tags -->
5454
<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" />
@@ -76,8 +76,8 @@ The Appwrite SDK uses ASWebAuthenticationSession on iOS 12+ and SFAuthentication
7676
### Linux
7777
For **Linux** add your app <u>name</u> and <u>package name</u>, Your package name is generally the **name** in your <a href="https://github.com/appwrite/playground-for-flutter/blob/0fdbdff98384fff940ed0b1e08cf14cfe3a2be3e/pubspec.yaml#L1" target="_blank" rel="noopener">pubspec.yaml<a> file. If you cannot find the correct package name, run the application in linux, and make any request with proper exception handling, you should get the application ID needed to add in the received error message.
7878

79-
### Mac OS
80-
For **Mac OS** add your app name and Bundle ID, You can find your Bundle Identifier in the General tab for your app's primary target in Xcode.
79+
### macOS
80+
For **macOS** add your app name and Bundle ID, You can find your Bundle Identifier in the General tab for your app's primary target in Xcode.
8181

8282
The Appwrite SDK uses ASWebAuthenticationSession on macOS 10.15+ to allow OAuth authentication. You have to change your macOS Deployment Target in Xcode to be macOS >= 10.15 to be able to build your app for macOS.
8383

@@ -121,77 +121,53 @@ For **Windows** add your app <u>name</u> and <u>package name</u>, Your package n
121121

122122
### Init your SDK
123123

124-
<p>Initialize your SDK with your Appwrite server API endpoint and project ID, which can be found in your project settings page.
124+
<p>Initialize your SDK with your project ID, which can be found in your project settings page.
125125

126126
```dart
127-
import 'package:appwrite/appwrite.dart';
128-
129-
void main() {
130-
Client client = Client();
131-
132-
client
133-
.setEndpoint('https://localhost/v1') // Your Appwrite Endpoint
134-
.setProject('5e8cf4f46b5e8') // Your project ID
135-
.setSelfSigned() // Use only on dev mode with a self-signed SSL cert
136-
;
137-
}
127+
Client client = Client().setProject('<YOUR_PROJECT_ID>');
138128
```
139129

140-
Before starting to send any API calls to your new Appwrite instance, make sure your Android or iOS emulators has network access to the Appwrite server hostname or IP address.
141-
142-
When trying to connect to Appwrite from an emulator or a mobile device, localhost is the hostname for the device or emulator and not your local Appwrite instance. You should replace localhost with your private IP as the Appwrite endpoint's hostname. You can also use a service like [ngrok](https://ngrok.com/) to proxy the Appwrite API.
130+
> If using a self-hosted instance, you will also need to set your Appwrite endpoint using the `setEndpoint` method. Before starting to send any API calls to your new Appwrite instance, make sure your Android or iOS emulators has network access to the Appwrite server hostname or IP address.
131+
> When trying to connect to a local Appwrite instance from an emulator or a mobile device, localhost is the hostname for the device or emulator and not your machine. You should replace localhost with your machine's private IP as the Appwrite endpoint's hostname (e.g. 192.168.1.100). You can also use a service like [ngrok](https://ngrok.com/) to proxy the Appwrite API.
143132
144133
### Make Your First Request
145134

146135
<p>Once your SDK object is set, access any of the Appwrite services and choose any request to send. Full documentation for any service method you would like to use can be found in your SDK documentation or in the [API References](https://appwrite.io/docs) section.
147136

148137
```dart
149-
// Register User
150138
Account account = Account(client);
151-
final user = await account
152-
.create(
153-
userId: ID.unique(), email: "[email protected]", password: "password", name: "Walter O'Brien"
154-
);
139+
140+
User user = await account.create(
141+
userId: ID.unique(),
142+
143+
password: 'password',
144+
name: 'Walter O'Brien',
145+
);
155146
```
156147

157148
### Full Example
158149

159150
```dart
160-
import 'package:appwrite/appwrite.dart';
161-
162-
void main() {
163-
Client client = Client();
164-
151+
Client client = Client().setProject('<YOUR_PROJECT_ID>>');
165152
166-
client
167-
.setEndpoint('https://localhost/v1') // Your Appwrite Endpoint
168-
.setProject('5e8cf4f46b5e8') // Your project ID
169-
.setSelfSigned() // Use only on dev mode with a self-signed SSL cert
170-
;
171-
172-
173-
// Register User
174-
Account account = Account(client);
153+
Account account = Account(client);
175154
176-
final user = await account
177-
.create(
178-
userId: ID.unique(), email: "[email protected]", password: "password", name: "Walter O'Brien"
179-
);
180-
}
155+
User user = await account.create(
156+
userId: ID.unique(),
157+
158+
password: 'password',
159+
name: 'Walter O'Brien'
160+
);
181161
```
182162

183163
### Error Handling
184164
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.
185165

186166
```dart
187-
Account account = Account(client);
188-
189167
try {
190-
final user = await account.create(userId: ID.unique(), email: "[email protected]", password: "password", name: "Walter O'Brien");
191-
print(user.toMap());
168+
User user = await account.create(...);
192169
} on AppwriteException catch(e) {
193-
//show message to user or do other operation based on error as required
194-
print(e.message);
170+
// Handle the exception
195171
}
196172
```
197173

analysis_options.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
include: package:flutter_lints/flutter.yaml
File renamed without changes.
File renamed without changes.

docs/examples/account/create-mfa-authenticator.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ Client client = Client()
66

77
Account account = Account(client);
88

9-
MfaType result = await account.createMfaAuthenticator(
9+
MfaType result = await account.createMFAAuthenticator(
1010
type: AuthenticatorType.totp,
1111
);

docs/examples/account/create-mfa-challenge.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ Client client = Client()
66

77
Account account = Account(client);
88

9-
MfaChallenge result = await account.createMfaChallenge(
9+
MfaChallenge result = await account.createMFAChallenge(
1010
factor: AuthenticationFactor.email,
1111
);

docs/examples/account/create-mfa-recovery-codes.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ Client client = Client()
66

77
Account account = Account(client);
88

9-
MfaRecoveryCodes result = await account.createMfaRecoveryCodes();
9+
MfaRecoveryCodes result = await account.createMFARecoveryCodes();
File renamed without changes.

0 commit comments

Comments
 (0)