Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
9997dcd
chore: regenerate
stnguyen90 Aug 18, 2025
568feb7
Commit from GitHub Actions (Format and push)
stnguyen90 Aug 18, 2025
b45f9b9
chore: regenerate
stnguyen90 Aug 18, 2025
3528027
Commit from GitHub Actions (Format and push)
stnguyen90 Aug 18, 2025
f2d133a
chore: regenerate
stnguyen90 Aug 19, 2025
0ffb9c8
Commit from GitHub Actions (Format and push)
stnguyen90 Aug 19, 2025
949ff46
chore: regenerate
stnguyen90 Aug 19, 2025
bb2cde1
Commit from GitHub Actions (Format and push)
stnguyen90 Aug 19, 2025
f9efe97
chore: regenerate
stnguyen90 Aug 19, 2025
39b575e
Commit from GitHub Actions (Format and push)
stnguyen90 Aug 19, 2025
1f67d58
Add 1.8.x support
abnegate Aug 19, 2025
432b39d
Commit from GitHub Actions (Format and push)
abnegate Aug 19, 2025
2eac6a2
chore: regenerate
stnguyen90 Aug 19, 2025
20ec74e
Commit from GitHub Actions (Format and push)
stnguyen90 Aug 19, 2025
18c5351
Add 1.8.x support
abnegate Aug 20, 2025
6176901
Commit from GitHub Actions (Format and push)
abnegate Aug 20, 2025
beace6a
Update doc
abnegate Aug 20, 2025
3f6382b
Commit from GitHub Actions (Format and push)
abnegate Aug 20, 2025
3e3518f
Add 1.8.x support
abnegate Aug 20, 2025
751acd8
Commit from GitHub Actions (Format and push)
abnegate Aug 20, 2025
b166892
Add 1.8.x support
abnegate Aug 20, 2025
9ee33f0
Commit from GitHub Actions (Format and push)
abnegate Aug 20, 2025
3b17f42
Fix casing
abnegate Aug 21, 2025
35ccecd
Commit from GitHub Actions (Format and push)
abnegate Aug 21, 2025
03d262e
Add 1.8.x support
abnegate Aug 23, 2025
b865af0
Commit from GitHub Actions (Format and push)
abnegate Aug 23, 2025
cb196e7
Add 1.8.x support
abnegate Aug 23, 2025
435297d
Commit from GitHub Actions (Format and push)
abnegate Aug 23, 2025
3de3d11
Fix filepaths
abnegate Aug 25, 2025
fde7dcd
Commit from GitHub Actions (Format and push)
abnegate Aug 25, 2025
8791de8
Fix docs
abnegate Aug 25, 2025
4f09b5d
Commit from GitHub Actions (Format and push)
abnegate Aug 25, 2025
c0c6c57
Fix casing
abnegate Aug 26, 2025
ac38bb8
Commit from GitHub Actions (Format and push)
abnegate Aug 26, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Analyze and test

on: pull_request

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install Flutter
uses: subosito/flutter-action@v2
with:
channel: stable
- run: flutter pub get
- run: flutter analyze --no-fatal-infos --no-fatal-warnings
- run: flutter test
21 changes: 21 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,26 @@
# Change Log

## 18.0.0

* Support for Appwrite 1.8
* Added TablesDB service
* Added new query types:
* `notContains`
* `notSearch`
* `notBetween`
* `notStartsWith`
* `notEndsWith`
* `createdBefore`
* `createdAfter`
* `updatedBefore`
* `updatedAfter`
* Deprecated `updateMagicURLSession`
* Deprecated `updatePhoneSession`
* Deprecated Databases service
> The TablesDB service is the new recommended way to work with databases.
> Existing databases/collections/attributes/documents can be managed using the TablesDB service.
> Existing Databases service will continue to work, but new features may only be added to the TablesDB service.

## 17.1.0

* Add `incrementDocumentAttribute` and `decrementDocumentAttribute` support to `Databases` service
Expand Down
78 changes: 27 additions & 51 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

[![pub package](https://img.shields.io/pub/v/appwrite?style=flat-square)](https://pub.dartlang.org/packages/appwrite)
![License](https://img.shields.io/github/license/appwrite/sdk-for-flutter.svg?style=flat-square)
![Version](https://img.shields.io/badge/api%20version-1.7.x-blue.svg?style=flat-square)
![Version](https://img.shields.io/badge/api%20version-1.8.x-blue.svg?style=flat-square)
[![Build Status](https://img.shields.io/travis/com/appwrite/sdk-generator?style=flat-square)](https://travis-ci.com/appwrite/sdk-generator)
[![Twitter Account](https://img.shields.io/twitter/follow/appwrite?color=00acee&label=twitter&style=flat-square)](https://twitter.com/appwrite)
[![Discord](https://img.shields.io/discord/564160730845151244?label=discord&style=flat-square)](https://appwrite.io/discord)

**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).**
**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).**

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)

Expand All @@ -21,7 +21,7 @@ Add this to your package's `pubspec.yaml` file:

```yml
dependencies:
appwrite: ^17.1.0
appwrite: ^18.0.0
```

You can install packages from the command line:
Expand Down Expand Up @@ -50,7 +50,7 @@ In order to capture the Appwrite OAuth callback url, the following activity need
....
<application ...>
....
<!-- Add this inside the <application> tag, along side the existing <activity> tags -->
<!-- Add this inside the <application> tag, alongside the existing <activity> tags -->
<activity android:exported="true" android:name="com.linusu.flutter_web_auth_2.CallbackActivity" >
<intent-filter android:label="flutter_web_auth_2">
<action android:name="android.intent.action.VIEW" />
Expand All @@ -76,8 +76,8 @@ The Appwrite SDK uses ASWebAuthenticationSession on iOS 12+ and SFAuthentication
### Linux
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.

### Mac OS
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.
### macOS
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.

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.

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

### Init your SDK

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

```dart
import 'package:appwrite/appwrite.dart';

void main() {
Client client = Client();

client
.setEndpoint('https://localhost/v1') // Your Appwrite Endpoint
.setProject('5e8cf4f46b5e8') // Your project ID
.setSelfSigned() // Use only on dev mode with a self-signed SSL cert
;
}
Client client = Client().setProject('<YOUR_PROJECT_ID>');
```

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.

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

### Make Your First Request

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

```dart
// Register User
Account account = Account(client);
final user = await account
.create(
userId: ID.unique(), email: "email@example.com", password: "password", name: "Walter O'Brien"
);

User user = await account.create(
userId: ID.unique(),
email: 'email@example.com',
password: 'password',
name: 'Walter O'Brien',
);
```

### Full Example

```dart
import 'package:appwrite/appwrite.dart';

void main() {
Client client = Client();

Client client = Client().setProject('<YOUR_PROJECT_ID>>');

client
.setEndpoint('https://localhost/v1') // Your Appwrite Endpoint
.setProject('5e8cf4f46b5e8') // Your project ID
.setSelfSigned() // Use only on dev mode with a self-signed SSL cert
;


// Register User
Account account = Account(client);
Account account = Account(client);

final user = await account
.create(
userId: ID.unique(), email: "email@example.com", password: "password", name: "Walter O'Brien"
);
}
User user = await account.create(
userId: ID.unique(),
email: 'email@example.com',
password: 'password',
name: 'Walter O'Brien'
);
```

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

```dart
Account account = Account(client);

try {
final user = await account.create(userId: ID.unique(), email: "email@example.com", password: "password", name: "Walter O'Brien");
print(user.toMap());
User user = await account.create(...);
} on AppwriteException catch(e) {
//show message to user or do other operation based on error as required
print(e.message);
// Handle the exception
}
```

Expand Down
1 change: 1 addition & 0 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include: package:flutter_lints/flutter.yaml
2 changes: 1 addition & 1 deletion docs/examples/account/create-mfa-authenticator.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ Client client = Client()

Account account = Account(client);

MfaType result = await account.createMfaAuthenticator(
MfaType result = await account.createMFAAuthenticator(
type: AuthenticatorType.totp,
);
2 changes: 1 addition & 1 deletion docs/examples/account/create-mfa-challenge.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ Client client = Client()

Account account = Account(client);

MfaChallenge result = await account.createMfaChallenge(
MfaChallenge result = await account.createMFAChallenge(
factor: AuthenticationFactor.email,
);
2 changes: 1 addition & 1 deletion docs/examples/account/create-mfa-recovery-codes.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ Client client = Client()

Account account = Account(client);

MfaRecoveryCodes result = await account.createMfaRecoveryCodes();
MfaRecoveryCodes result = await account.createMFARecoveryCodes();
2 changes: 1 addition & 1 deletion docs/examples/account/delete-mfa-authenticator.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ Client client = Client()

Account account = Account(client);

await account.deleteMfaAuthenticator(
await account.deleteMFAAuthenticator(
type: AuthenticatorType.totp,
);
2 changes: 1 addition & 1 deletion docs/examples/account/get-mfa-recovery-codes.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ Client client = Client()

Account account = Account(client);

MfaRecoveryCodes result = await account.getMfaRecoveryCodes();
MfaRecoveryCodes result = await account.getMFARecoveryCodes();
2 changes: 1 addition & 1 deletion docs/examples/account/list-mfa-factors.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ Client client = Client()

Account account = Account(client);

MfaFactors result = await account.listMfaFactors();
MfaFactors result = await account.listMFAFactors();
2 changes: 1 addition & 1 deletion docs/examples/account/update-mfa-authenticator.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Client client = Client()

Account account = Account(client);

User result = await account.updateMfaAuthenticator(
User result = await account.updateMFAAuthenticator(
type: AuthenticatorType.totp,
otp: '<OTP>',
);
2 changes: 1 addition & 1 deletion docs/examples/account/update-mfa-challenge.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Client client = Client()

Account account = Account(client);

Session result = await account.updateMfaChallenge(
Session result = await account.updateMFAChallenge(
challengeId: '<CHALLENGE_ID>',
otp: '<OTP>',
);
2 changes: 1 addition & 1 deletion docs/examples/account/update-mfa-recovery-codes.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ Client client = Client()

Account account = Account(client);

MfaRecoveryCodes result = await account.updateMfaRecoveryCodes();
MfaRecoveryCodes result = await account.updateMFARecoveryCodes();
File renamed without changes.
2 changes: 1 addition & 1 deletion docs/examples/functions/create-execution.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ Execution result = await functions.createExecution(
path: '<PATH>', // optional
method: ExecutionMethod.gET, // optional
headers: {}, // optional
scheduledAt: '', // optional
scheduledAt: '<SCHEDULED_AT>', // optional
);
15 changes: 15 additions & 0 deletions docs/examples/tablesdb/create-row.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import 'package:appwrite/appwrite.dart';

Client client = Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>'); // Your project ID

TablesDB tablesDB = TablesDB(client);

Row result = await tablesDB.createRow(
databaseId: '<DATABASE_ID>',
tableId: '<TABLE_ID>',
rowId: '<ROW_ID>',
data: {},
permissions: ["read("any")"], // optional
);
16 changes: 16 additions & 0 deletions docs/examples/tablesdb/decrement-row-column.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import 'package:appwrite/appwrite.dart';

Client client = Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>'); // Your project ID

TablesDB tablesDB = TablesDB(client);

Row result = await tablesDB.decrementRowColumn(
databaseId: '<DATABASE_ID>',
tableId: '<TABLE_ID>',
rowId: '<ROW_ID>',
column: '',
value: 0, // optional
min: 0, // optional
);
13 changes: 13 additions & 0 deletions docs/examples/tablesdb/delete-row.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import 'package:appwrite/appwrite.dart';

Client client = Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>'); // Your project ID

TablesDB tablesDB = TablesDB(client);

await tablesDB.deleteRow(
databaseId: '<DATABASE_ID>',
tableId: '<TABLE_ID>',
rowId: '<ROW_ID>',
);
14 changes: 14 additions & 0 deletions docs/examples/tablesdb/get-row.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import 'package:appwrite/appwrite.dart';

Client client = Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>'); // Your project ID

TablesDB tablesDB = TablesDB(client);

Row result = await tablesDB.getRow(
databaseId: '<DATABASE_ID>',
tableId: '<TABLE_ID>',
rowId: '<ROW_ID>',
queries: [], // optional
);
16 changes: 16 additions & 0 deletions docs/examples/tablesdb/increment-row-column.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import 'package:appwrite/appwrite.dart';

Client client = Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>'); // Your project ID

TablesDB tablesDB = TablesDB(client);

Row result = await tablesDB.incrementRowColumn(
databaseId: '<DATABASE_ID>',
tableId: '<TABLE_ID>',
rowId: '<ROW_ID>',
column: '',
value: 0, // optional
max: 0, // optional
);
13 changes: 13 additions & 0 deletions docs/examples/tablesdb/list-rows.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import 'package:appwrite/appwrite.dart';

Client client = Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>'); // Your project ID

TablesDB tablesDB = TablesDB(client);

RowList result = await tablesDB.listRows(
databaseId: '<DATABASE_ID>',
tableId: '<TABLE_ID>',
queries: [], // optional
);
15 changes: 15 additions & 0 deletions docs/examples/tablesdb/update-row.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import 'package:appwrite/appwrite.dart';

Client client = Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>'); // Your project ID

TablesDB tablesDB = TablesDB(client);

Row result = await tablesDB.updateRow(
databaseId: '<DATABASE_ID>',
tableId: '<TABLE_ID>',
rowId: '<ROW_ID>',
data: {}, // optional
permissions: ["read("any")"], // optional
);
15 changes: 15 additions & 0 deletions docs/examples/tablesdb/upsert-row.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import 'package:appwrite/appwrite.dart';

Client client = Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>'); // Your project ID

TablesDB tablesDB = TablesDB(client);

Row result = await tablesDB.upsertRow(
databaseId: '<DATABASE_ID>',
tableId: '<TABLE_ID>',
rowId: '<ROW_ID>',
data: {}, // optional
permissions: ["read("any")"], // optional
);
Loading