mirror of
https://github.com/appwrite/sdk-for-flutter.git
synced 2026-04-07 19:27:41 +00:00
Add 1.8.x support
This commit is contained in:
@@ -1,16 +0,0 @@
|
||||
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
|
||||
|
||||
Databases databases = Databases(client);
|
||||
|
||||
Document result = await databases.decrementDocumentAttribute(
|
||||
databaseId: '<DATABASE_ID>',
|
||||
collectionId: '<COLLECTION_ID>',
|
||||
documentId: '<DOCUMENT_ID>',
|
||||
attribute: '',
|
||||
value: 0, // optional
|
||||
min: 0, // optional
|
||||
);
|
||||
@@ -1,16 +0,0 @@
|
||||
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
|
||||
|
||||
Databases databases = Databases(client);
|
||||
|
||||
Document result = await databases.incrementDocumentAttribute(
|
||||
databaseId: '<DATABASE_ID>',
|
||||
collectionId: '<COLLECTION_ID>',
|
||||
documentId: '<DOCUMENT_ID>',
|
||||
attribute: '',
|
||||
value: 0, // optional
|
||||
max: 0, // optional
|
||||
);
|
||||
@@ -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
|
||||
);
|
||||
@@ -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>',
|
||||
);
|
||||
@@ -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
|
||||
);
|
||||
@@ -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
|
||||
);
|
||||
@@ -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
|
||||
);
|
||||
@@ -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
|
||||
);
|
||||
Reference in New Issue
Block a user