Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Change Log

## 26.2.0

* Added: `DocumentsDB` and `VectorsDB` services for document and vector database access
* Added: `userId`, `emailHash` and `name` parameters to `Avatars.getPhoto()`
* Added: `cloudflare` and `resend` values to `OAuthProvider` enum
* Added: `auto` value to `ImageGravity` enum
* Updated: `X-Appwrite-Response-Format` header to `2.0.0`

## 26.1.0

* Fixed: realtime policy-violation errors are now delivered to active subscription streams instead of thrown from the message handler
Expand Down
6 changes: 3 additions & 3 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.9.x-blue.svg?style=flat-square)
![Version](https://img.shields.io/badge/api%20version-2.0.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.9.x. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-flutter/releases).**
**This SDK targets Appwrite server version 2.0.x as shipped on Appwrite Cloud.** Self-hosted releases can lag behind Cloud — if you run an older self-hosted build, use a matching older SDK from [previous releases](https://github.com/appwrite/sdk-for-flutter/releases) when APIs differ.

Appwrite is an open-source backend as a service server that abstracts and simplifies 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 @@ -19,7 +19,7 @@ Add this to your package's `pubspec.yaml` file:

```yml
dependencies:
appwrite: ^26.0.0
appwrite: ^26.2.0
```

You can install packages from the command line:
Expand Down
4 changes: 2 additions & 2 deletions docs/examples/avatars/get-initials.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Uint8List bytes = await avatars.getInitials(
name: '<NAME>', // optional
width: 0, // optional
height: 0, // optional
background: '', // optional
background: 'FFFFFF', // optional
);

final file = File('path_to_file/filename.ext');
Expand All @@ -27,7 +27,7 @@ FutureBuilder<Uint8List>(
name: '<NAME>', // optional
width: 0, // optional
height: 0, // optional
background: '', // optional
background: 'FFFFFF', // optional
), // Works for both public file and private file, for private files you need to be logged in
builder: (context, snapshot) {
return snapshot.hasData && snapshot.data != null
Expand Down
6 changes: 6 additions & 0 deletions docs/examples/avatars/get-photo.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ Uint8List bytes = await avatars.getPhoto(
quality: 0, // optional
output: 'png', // optional
rating: 'g', // optional
userId: 'current()', // optional
emailHash: '<EMAIL_HASH>', // optional
name: '<NAME>', // optional
);

final file = File('path_to_file/filename.ext');
Expand All @@ -30,6 +33,9 @@ FutureBuilder<Uint8List>(
quality: 0, // optional
output: 'png', // optional
rating: 'g', // optional
userId: 'current()', // optional
emailHash: '<EMAIL_HASH>', // optional
name: '<NAME>', // optional
), // Works for both public file and private file, for private files you need to be logged in
builder: (context, snapshot) {
return snapshot.hasData && snapshot.data != null
Expand Down
4 changes: 2 additions & 2 deletions docs/examples/databases/decrement-document-attribute.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ Document result = await databases.decrementDocumentAttribute(
databaseId: '<DATABASE_ID>',
collectionId: '<COLLECTION_ID>',
documentId: '<DOCUMENT_ID>',
attribute: '',
value: 0, // optional
attribute: '<ATTRIBUTE>',
value: 1, // optional
min: 0, // optional
transactionId: '<TRANSACTION_ID>', // optional
);
Expand Down
6 changes: 3 additions & 3 deletions docs/examples/databases/increment-document-attribute.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ Document result = await databases.incrementDocumentAttribute(
databaseId: '<DATABASE_ID>',
collectionId: '<COLLECTION_ID>',
documentId: '<DOCUMENT_ID>',
attribute: '',
value: 0, // optional
max: 0, // optional
attribute: '<ATTRIBUTE>',
value: 1, // optional
max: 100, // optional
transactionId: '<TRANSACTION_ID>', // optional
);
```
26 changes: 26 additions & 0 deletions docs/examples/documentsdb/create-document.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
```dart
import 'package:appwrite/appwrite.dart';
import 'package:appwrite/permission.dart';
import 'package:appwrite/role.dart';

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

DocumentsDB documentsDB = DocumentsDB(client);

Document result = await documentsDB.createDocument(
databaseId: '<DATABASE_ID>',
collectionId: '<COLLECTION_ID>',
documentId: '<DOCUMENT_ID>',
data: {
"username": "walter.obrien",
"email": "walter.obrien@example.com",
"fullName": "Walter O'Brien",
"age": 30,
"isAdmin": false
},
permissions: [Permission.read(Role.any())], // optional
transactionId: '<TRANSACTION_ID>', // optional
);
```
16 changes: 16 additions & 0 deletions docs/examples/documentsdb/create-documents.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
```dart
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

DocumentsDB documentsDB = DocumentsDB(client);

DocumentList result = await documentsDB.createDocuments(
databaseId: '<DATABASE_ID>',
collectionId: '<COLLECTION_ID>',
documents: [],
transactionId: '<TRANSACTION_ID>', // optional
);
```
24 changes: 24 additions & 0 deletions docs/examples/documentsdb/create-operations.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
```dart
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

DocumentsDB documentsDB = DocumentsDB(client);

Transaction result = await documentsDB.createOperations(
transactionId: '<TRANSACTION_ID>',
operations: [
{
"action": "create",
"databaseId": "<DATABASE_ID>",
"collectionId": "<COLLECTION_ID>",
"documentId": "<DOCUMENT_ID>",
"data": {
"name": "Walter O'Brien"
}
}
], // optional
);
```
13 changes: 13 additions & 0 deletions docs/examples/documentsdb/create-transaction.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
```dart
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

DocumentsDB documentsDB = DocumentsDB(client);

Transaction result = await documentsDB.createTransaction(
ttl: 60, // optional
);
```
19 changes: 19 additions & 0 deletions docs/examples/documentsdb/decrement-document-attribute.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
```dart
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

DocumentsDB documentsDB = DocumentsDB(client);

Document result = await documentsDB.decrementDocumentAttribute(
databaseId: '<DATABASE_ID>',
collectionId: '<COLLECTION_ID>',
documentId: '<DOCUMENT_ID>',
attribute: '<ATTRIBUTE>',
value: 1, // optional
min: 0, // optional
transactionId: '<TRANSACTION_ID>', // optional
);
```
16 changes: 16 additions & 0 deletions docs/examples/documentsdb/delete-document.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
```dart
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

DocumentsDB documentsDB = DocumentsDB(client);

await documentsDB.deleteDocument(
databaseId: '<DATABASE_ID>',
collectionId: '<COLLECTION_ID>',
documentId: '<DOCUMENT_ID>',
transactionId: '<TRANSACTION_ID>', // optional
);
```
13 changes: 13 additions & 0 deletions docs/examples/documentsdb/delete-transaction.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
```dart
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

DocumentsDB documentsDB = DocumentsDB(client);

await documentsDB.deleteTransaction(
transactionId: '<TRANSACTION_ID>',
);
```
17 changes: 17 additions & 0 deletions docs/examples/documentsdb/get-document.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
```dart
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

DocumentsDB documentsDB = DocumentsDB(client);

Document result = await documentsDB.getDocument(
databaseId: '<DATABASE_ID>',
collectionId: '<COLLECTION_ID>',
documentId: '<DOCUMENT_ID>',
queries: [], // optional
transactionId: '<TRANSACTION_ID>', // optional
);
```
13 changes: 13 additions & 0 deletions docs/examples/documentsdb/get-transaction.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
```dart
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

DocumentsDB documentsDB = DocumentsDB(client);

Transaction result = await documentsDB.getTransaction(
transactionId: '<TRANSACTION_ID>',
);
```
19 changes: 19 additions & 0 deletions docs/examples/documentsdb/increment-document-attribute.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
```dart
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

DocumentsDB documentsDB = DocumentsDB(client);

Document result = await documentsDB.incrementDocumentAttribute(
databaseId: '<DATABASE_ID>',
collectionId: '<COLLECTION_ID>',
documentId: '<DOCUMENT_ID>',
attribute: '<ATTRIBUTE>',
value: 1, // optional
max: 100, // optional
transactionId: '<TRANSACTION_ID>', // optional
);
```
18 changes: 18 additions & 0 deletions docs/examples/documentsdb/list-documents.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
```dart
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

DocumentsDB documentsDB = DocumentsDB(client);

DocumentList result = await documentsDB.listDocuments(
databaseId: '<DATABASE_ID>',
collectionId: '<COLLECTION_ID>',
queries: [], // optional
transactionId: '<TRANSACTION_ID>', // optional
total: false, // optional
ttl: 0, // optional
);
```
13 changes: 13 additions & 0 deletions docs/examples/documentsdb/list-transactions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
```dart
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

DocumentsDB documentsDB = DocumentsDB(client);

TransactionList result = await documentsDB.listTransactions(
queries: [], // optional
);
```
20 changes: 20 additions & 0 deletions docs/examples/documentsdb/update-document.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
```dart
import 'package:appwrite/appwrite.dart';
import 'package:appwrite/permission.dart';
import 'package:appwrite/role.dart';

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

DocumentsDB documentsDB = DocumentsDB(client);

Document result = await documentsDB.updateDocument(
databaseId: '<DATABASE_ID>',
collectionId: '<COLLECTION_ID>',
documentId: '<DOCUMENT_ID>',
data: {}, // optional
permissions: [Permission.read(Role.any())], // optional
transactionId: '<TRANSACTION_ID>', // optional
);
```
15 changes: 15 additions & 0 deletions docs/examples/documentsdb/update-transaction.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
```dart
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

DocumentsDB documentsDB = DocumentsDB(client);

Transaction result = await documentsDB.updateTransaction(
transactionId: '<TRANSACTION_ID>',
commit: false, // optional
rollback: false, // optional
);
```
20 changes: 20 additions & 0 deletions docs/examples/documentsdb/upsert-document.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
```dart
import 'package:appwrite/appwrite.dart';
import 'package:appwrite/permission.dart';
import 'package:appwrite/role.dart';

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

DocumentsDB documentsDB = DocumentsDB(client);

Document result = await documentsDB.upsertDocument(
databaseId: '<DATABASE_ID>',
collectionId: '<COLLECTION_ID>',
documentId: '<DOCUMENT_ID>',
data: {}, // optional
permissions: [Permission.read(Role.any())], // optional
transactionId: '<TRANSACTION_ID>', // optional
);
```
2 changes: 1 addition & 1 deletion docs/examples/storage/create-file.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ File result = await storage.createFile(
fileId: '<FILE_ID>',
file: InputFile(path: './path-to-files/image.jpg', filename: 'image.jpg'),
permissions: [Permission.read(Role.any())], // optional
folder: '', // optional
folder: 'photos/2026', // optional
);
```
Loading