Updated code examples

This commit is contained in:
Eldad Fux 2020-12-23 21:30:05 +02:00
parent fd2914737c
commit 5157d3fdd7
1453 changed files with 24072 additions and 0 deletions

View file

@ -0,0 +1,22 @@
import 'package:appwrite_dev/appwrite_dev.dart';
void main() { // Init SDK
Client client = Client();
Account account = Account(client);
client
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
.setProject('5df5acd0d48c2') // Your project ID
;
Future result = account.createOAuth2Session(
provider: 'amazon',
);
result
.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
}

View file

@ -0,0 +1,23 @@
import 'package:appwrite_dev/appwrite_dev.dart';
void main() { // Init SDK
Client client = Client();
Account account = Account(client);
client
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
.setProject('5df5acd0d48c2') // Your project ID
;
Future result = account.createRecovery(
email: 'email@example.com',
url: 'https://example.com',
);
result
.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
}

View file

@ -0,0 +1,23 @@
import 'package:appwrite_dev/appwrite_dev.dart';
void main() { // Init SDK
Client client = Client();
Account account = Account(client);
client
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
.setProject('5df5acd0d48c2') // Your project ID
;
Future result = account.createSession(
email: 'email@example.com',
password: 'password',
);
result
.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
}

View file

@ -0,0 +1,22 @@
import 'package:appwrite_dev/appwrite_dev.dart';
void main() { // Init SDK
Client client = Client();
Account account = Account(client);
client
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
.setProject('5df5acd0d48c2') // Your project ID
;
Future result = account.createVerification(
url: 'https://example.com',
);
result
.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
}

View file

@ -0,0 +1,23 @@
import 'package:appwrite_dev/appwrite_dev.dart';
void main() { // Init SDK
Client client = Client();
Account account = Account(client);
client
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
.setProject('5df5acd0d48c2') // Your project ID
;
Future result = account.create(
email: 'email@example.com',
password: 'password',
);
result
.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
}

View file

@ -0,0 +1,22 @@
import 'package:appwrite_dev/appwrite_dev.dart';
void main() { // Init SDK
Client client = Client();
Account account = Account(client);
client
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
.setProject('5df5acd0d48c2') // Your project ID
;
Future result = account.deleteSession(
sessionId: '[SESSION_ID]',
);
result
.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
}

View file

@ -0,0 +1,20 @@
import 'package:appwrite_dev/appwrite_dev.dart';
void main() { // Init SDK
Client client = Client();
Account account = Account(client);
client
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
.setProject('5df5acd0d48c2') // Your project ID
;
Future result = account.deleteSessions( );
result
.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
}

View file

@ -0,0 +1,20 @@
import 'package:appwrite_dev/appwrite_dev.dart';
void main() { // Init SDK
Client client = Client();
Account account = Account(client);
client
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
.setProject('5df5acd0d48c2') // Your project ID
;
Future result = account.delete( );
result
.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
}

View file

@ -0,0 +1,20 @@
import 'package:appwrite_dev/appwrite_dev.dart';
void main() { // Init SDK
Client client = Client();
Account account = Account(client);
client
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
.setProject('5df5acd0d48c2') // Your project ID
;
Future result = account.getLogs( );
result
.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
}

View file

@ -0,0 +1,20 @@
import 'package:appwrite_dev/appwrite_dev.dart';
void main() { // Init SDK
Client client = Client();
Account account = Account(client);
client
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
.setProject('5df5acd0d48c2') // Your project ID
;
Future result = account.getPrefs( );
result
.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
}

View file

@ -0,0 +1,20 @@
import 'package:appwrite_dev/appwrite_dev.dart';
void main() { // Init SDK
Client client = Client();
Account account = Account(client);
client
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
.setProject('5df5acd0d48c2') // Your project ID
;
Future result = account.getSessions( );
result
.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
}

View file

@ -0,0 +1,20 @@
import 'package:appwrite_dev/appwrite_dev.dart';
void main() { // Init SDK
Client client = Client();
Account account = Account(client);
client
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
.setProject('5df5acd0d48c2') // Your project ID
;
Future result = account.get( );
result
.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
}

View file

@ -0,0 +1,23 @@
import 'package:appwrite_dev/appwrite_dev.dart';
void main() { // Init SDK
Client client = Client();
Account account = Account(client);
client
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
.setProject('5df5acd0d48c2') // Your project ID
;
Future result = account.updateEmail(
email: 'email@example.com',
password: 'password',
);
result
.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
}

View file

@ -0,0 +1,22 @@
import 'package:appwrite_dev/appwrite_dev.dart';
void main() { // Init SDK
Client client = Client();
Account account = Account(client);
client
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
.setProject('5df5acd0d48c2') // Your project ID
;
Future result = account.updateName(
name: '[NAME]',
);
result
.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
}

View file

@ -0,0 +1,23 @@
import 'package:appwrite_dev/appwrite_dev.dart';
void main() { // Init SDK
Client client = Client();
Account account = Account(client);
client
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
.setProject('5df5acd0d48c2') // Your project ID
;
Future result = account.updatePassword(
password: 'password',
oldPassword: 'password',
);
result
.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
}

View file

@ -0,0 +1,22 @@
import 'package:appwrite_dev/appwrite_dev.dart';
void main() { // Init SDK
Client client = Client();
Account account = Account(client);
client
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
.setProject('5df5acd0d48c2') // Your project ID
;
Future result = account.updatePrefs(
prefs: {},
);
result
.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
}

View file

@ -0,0 +1,25 @@
import 'package:appwrite_dev/appwrite_dev.dart';
void main() { // Init SDK
Client client = Client();
Account account = Account(client);
client
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
.setProject('5df5acd0d48c2') // Your project ID
;
Future result = account.updateRecovery(
userId: '[USER_ID]',
secret: '[SECRET]',
password: 'password',
passwordAgain: 'password',
);
result
.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
}

View file

@ -0,0 +1,23 @@
import 'package:appwrite_dev/appwrite_dev.dart';
void main() { // Init SDK
Client client = Client();
Account account = Account(client);
client
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
.setProject('5df5acd0d48c2') // Your project ID
;
Future result = account.updateVerification(
userId: '[USER_ID]',
secret: '[SECRET]',
);
result
.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
}

View file

@ -0,0 +1,17 @@
import 'package:appwrite_dev/appwrite_dev.dart';
void main() { // Init SDK
Client client = Client();
Avatars avatars = Avatars(client);
client
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
.setProject('5df5acd0d48c2') // Your project ID
;
String result = avatars.getBrowser(
code: 'aa',
);
print(result); // Resource URL string
}

View file

@ -0,0 +1,17 @@
import 'package:appwrite_dev/appwrite_dev.dart';
void main() { // Init SDK
Client client = Client();
Avatars avatars = Avatars(client);
client
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
.setProject('5df5acd0d48c2') // Your project ID
;
String result = avatars.getCreditCard(
code: 'amex',
);
print(result); // Resource URL string
}

View file

@ -0,0 +1,17 @@
import 'package:appwrite_dev/appwrite_dev.dart';
void main() { // Init SDK
Client client = Client();
Avatars avatars = Avatars(client);
client
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
.setProject('5df5acd0d48c2') // Your project ID
;
String result = avatars.getFavicon(
url: 'https://example.com',
);
print(result); // Resource URL string
}

View file

@ -0,0 +1,17 @@
import 'package:appwrite_dev/appwrite_dev.dart';
void main() { // Init SDK
Client client = Client();
Avatars avatars = Avatars(client);
client
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
.setProject('5df5acd0d48c2') // Your project ID
;
String result = avatars.getFlag(
code: 'af',
);
print(result); // Resource URL string
}

View file

@ -0,0 +1,17 @@
import 'package:appwrite_dev/appwrite_dev.dart';
void main() { // Init SDK
Client client = Client();
Avatars avatars = Avatars(client);
client
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
.setProject('5df5acd0d48c2') // Your project ID
;
String result = avatars.getImage(
url: 'https://example.com',
);
print(result); // Resource URL string
}

View file

@ -0,0 +1,16 @@
import 'package:appwrite_dev/appwrite_dev.dart';
void main() { // Init SDK
Client client = Client();
Avatars avatars = Avatars(client);
client
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
.setProject('5df5acd0d48c2') // Your project ID
;
String result = avatars.getInitials(
);
print(result); // Resource URL string
}

View file

@ -0,0 +1,17 @@
import 'package:appwrite_dev/appwrite_dev.dart';
void main() { // Init SDK
Client client = Client();
Avatars avatars = Avatars(client);
client
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
.setProject('5df5acd0d48c2') // Your project ID
;
String result = avatars.getQR(
text: '[TEXT]',
);
print(result); // Resource URL string
}

View file

@ -0,0 +1,25 @@
import 'package:appwrite_dev/appwrite_dev.dart';
void main() { // Init SDK
Client client = Client();
Database database = Database(client);
client
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
.setProject('5df5acd0d48c2') // Your project ID
;
Future result = database.createDocument(
collectionId: '[COLLECTION_ID]',
data: {},
read: [],
write: [],
);
result
.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
}

View file

@ -0,0 +1,23 @@
import 'package:appwrite_dev/appwrite_dev.dart';
void main() { // Init SDK
Client client = Client();
Database database = Database(client);
client
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
.setProject('5df5acd0d48c2') // Your project ID
;
Future result = database.deleteDocument(
collectionId: '[COLLECTION_ID]',
documentId: '[DOCUMENT_ID]',
);
result
.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
}

View file

@ -0,0 +1,23 @@
import 'package:appwrite_dev/appwrite_dev.dart';
void main() { // Init SDK
Client client = Client();
Database database = Database(client);
client
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
.setProject('5df5acd0d48c2') // Your project ID
;
Future result = database.getDocument(
collectionId: '[COLLECTION_ID]',
documentId: '[DOCUMENT_ID]',
);
result
.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
}

View file

@ -0,0 +1,22 @@
import 'package:appwrite_dev/appwrite_dev.dart';
void main() { // Init SDK
Client client = Client();
Database database = Database(client);
client
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
.setProject('5df5acd0d48c2') // Your project ID
;
Future result = database.listDocuments(
collectionId: '[COLLECTION_ID]',
);
result
.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
}

View file

@ -0,0 +1,26 @@
import 'package:appwrite_dev/appwrite_dev.dart';
void main() { // Init SDK
Client client = Client();
Database database = Database(client);
client
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
.setProject('5df5acd0d48c2') // Your project ID
;
Future result = database.updateDocument(
collectionId: '[COLLECTION_ID]',
documentId: '[DOCUMENT_ID]',
data: {},
read: [],
write: [],
);
result
.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
}

View file

@ -0,0 +1,20 @@
import 'package:appwrite_dev/appwrite_dev.dart';
void main() { // Init SDK
Client client = Client();
Locale locale = Locale(client);
client
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
.setProject('5df5acd0d48c2') // Your project ID
;
Future result = locale.getContinents( );
result
.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
}

View file

@ -0,0 +1,20 @@
import 'package:appwrite_dev/appwrite_dev.dart';
void main() { // Init SDK
Client client = Client();
Locale locale = Locale(client);
client
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
.setProject('5df5acd0d48c2') // Your project ID
;
Future result = locale.getCountriesEU( );
result
.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
}

View file

@ -0,0 +1,20 @@
import 'package:appwrite_dev/appwrite_dev.dart';
void main() { // Init SDK
Client client = Client();
Locale locale = Locale(client);
client
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
.setProject('5df5acd0d48c2') // Your project ID
;
Future result = locale.getCountriesPhones( );
result
.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
}

View file

@ -0,0 +1,20 @@
import 'package:appwrite_dev/appwrite_dev.dart';
void main() { // Init SDK
Client client = Client();
Locale locale = Locale(client);
client
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
.setProject('5df5acd0d48c2') // Your project ID
;
Future result = locale.getCountries( );
result
.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
}

View file

@ -0,0 +1,20 @@
import 'package:appwrite_dev/appwrite_dev.dart';
void main() { // Init SDK
Client client = Client();
Locale locale = Locale(client);
client
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
.setProject('5df5acd0d48c2') // Your project ID
;
Future result = locale.getCurrencies( );
result
.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
}

View file

@ -0,0 +1,20 @@
import 'package:appwrite_dev/appwrite_dev.dart';
void main() { // Init SDK
Client client = Client();
Locale locale = Locale(client);
client
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
.setProject('5df5acd0d48c2') // Your project ID
;
Future result = locale.getLanguages( );
result
.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
}

View file

@ -0,0 +1,20 @@
import 'package:appwrite_dev/appwrite_dev.dart';
void main() { // Init SDK
Client client = Client();
Locale locale = Locale(client);
client
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
.setProject('5df5acd0d48c2') // Your project ID
;
Future result = locale.get( );
result
.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
}

View file

@ -0,0 +1,25 @@
import 'dart:io';
import 'package:appwrite_dev/appwrite_dev.dart';
void main() { // Init SDK
Client client = Client();
Storage storage = Storage(client);
client
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
.setProject('5df5acd0d48c2') // Your project ID
;
Future result = storage.createFile(
file: await MultipartFile.fromFile('./path-to-files/image.jpg', 'image.jpg'),
read: [],
write: [],
);
result
.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
}

View file

@ -0,0 +1,22 @@
import 'package:appwrite_dev/appwrite_dev.dart';
void main() { // Init SDK
Client client = Client();
Storage storage = Storage(client);
client
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
.setProject('5df5acd0d48c2') // Your project ID
;
Future result = storage.deleteFile(
fileId: '[FILE_ID]',
);
result
.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
}

View file

@ -0,0 +1,17 @@
import 'package:appwrite_dev/appwrite_dev.dart';
void main() { // Init SDK
Client client = Client();
Storage storage = Storage(client);
client
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
.setProject('5df5acd0d48c2') // Your project ID
;
String result = storage.getFileDownload(
fileId: '[FILE_ID]',
);
print(result); // Resource URL string
}

View file

@ -0,0 +1,17 @@
import 'package:appwrite_dev/appwrite_dev.dart';
void main() { // Init SDK
Client client = Client();
Storage storage = Storage(client);
client
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
.setProject('5df5acd0d48c2') // Your project ID
;
String result = storage.getFilePreview(
fileId: '[FILE_ID]',
);
print(result); // Resource URL string
}

View file

@ -0,0 +1,17 @@
import 'package:appwrite_dev/appwrite_dev.dart';
void main() { // Init SDK
Client client = Client();
Storage storage = Storage(client);
client
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
.setProject('5df5acd0d48c2') // Your project ID
;
String result = storage.getFileView(
fileId: '[FILE_ID]',
);
print(result); // Resource URL string
}

View file

@ -0,0 +1,22 @@
import 'package:appwrite_dev/appwrite_dev.dart';
void main() { // Init SDK
Client client = Client();
Storage storage = Storage(client);
client
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
.setProject('5df5acd0d48c2') // Your project ID
;
Future result = storage.getFile(
fileId: '[FILE_ID]',
);
result
.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
}

View file

@ -0,0 +1,21 @@
import 'package:appwrite_dev/appwrite_dev.dart';
void main() { // Init SDK
Client client = Client();
Storage storage = Storage(client);
client
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
.setProject('5df5acd0d48c2') // Your project ID
;
Future result = storage.listFiles(
);
result
.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
}

View file

@ -0,0 +1,24 @@
import 'package:appwrite_dev/appwrite_dev.dart';
void main() { // Init SDK
Client client = Client();
Storage storage = Storage(client);
client
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
.setProject('5df5acd0d48c2') // Your project ID
;
Future result = storage.updateFile(
fileId: '[FILE_ID]',
read: [],
write: [],
);
result
.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
}

View file

@ -0,0 +1,25 @@
import 'package:appwrite_dev/appwrite_dev.dart';
void main() { // Init SDK
Client client = Client();
Teams teams = Teams(client);
client
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
.setProject('5df5acd0d48c2') // Your project ID
;
Future result = teams.createMembership(
teamId: '[TEAM_ID]',
email: 'email@example.com',
roles: [],
url: 'https://example.com',
);
result
.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
}

View file

@ -0,0 +1,22 @@
import 'package:appwrite_dev/appwrite_dev.dart';
void main() { // Init SDK
Client client = Client();
Teams teams = Teams(client);
client
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
.setProject('5df5acd0d48c2') // Your project ID
;
Future result = teams.create(
name: '[NAME]',
);
result
.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
}

View file

@ -0,0 +1,23 @@
import 'package:appwrite_dev/appwrite_dev.dart';
void main() { // Init SDK
Client client = Client();
Teams teams = Teams(client);
client
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
.setProject('5df5acd0d48c2') // Your project ID
;
Future result = teams.deleteMembership(
teamId: '[TEAM_ID]',
inviteId: '[INVITE_ID]',
);
result
.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
}

View file

@ -0,0 +1,22 @@
import 'package:appwrite_dev/appwrite_dev.dart';
void main() { // Init SDK
Client client = Client();
Teams teams = Teams(client);
client
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
.setProject('5df5acd0d48c2') // Your project ID
;
Future result = teams.delete(
teamId: '[TEAM_ID]',
);
result
.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
}

View file

@ -0,0 +1,22 @@
import 'package:appwrite_dev/appwrite_dev.dart';
void main() { // Init SDK
Client client = Client();
Teams teams = Teams(client);
client
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
.setProject('5df5acd0d48c2') // Your project ID
;
Future result = teams.getMemberships(
teamId: '[TEAM_ID]',
);
result
.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
}

View file

@ -0,0 +1,22 @@
import 'package:appwrite_dev/appwrite_dev.dart';
void main() { // Init SDK
Client client = Client();
Teams teams = Teams(client);
client
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
.setProject('5df5acd0d48c2') // Your project ID
;
Future result = teams.get(
teamId: '[TEAM_ID]',
);
result
.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
}

View file

@ -0,0 +1,21 @@
import 'package:appwrite_dev/appwrite_dev.dart';
void main() { // Init SDK
Client client = Client();
Teams teams = Teams(client);
client
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
.setProject('5df5acd0d48c2') // Your project ID
;
Future result = teams.list(
);
result
.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
}

View file

@ -0,0 +1,25 @@
import 'package:appwrite_dev/appwrite_dev.dart';
void main() { // Init SDK
Client client = Client();
Teams teams = Teams(client);
client
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
.setProject('5df5acd0d48c2') // Your project ID
;
Future result = teams.updateMembershipStatus(
teamId: '[TEAM_ID]',
inviteId: '[INVITE_ID]',
userId: '[USER_ID]',
secret: '[SECRET]',
);
result
.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
}

View file

@ -0,0 +1,23 @@
import 'package:appwrite_dev/appwrite_dev.dart';
void main() { // Init SDK
Client client = Client();
Teams teams = Teams(client);
client
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
.setProject('5df5acd0d48c2') // Your project ID
;
Future result = teams.update(
teamId: '[TEAM_ID]',
name: '[NAME]',
);
result
.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
}

View file

@ -0,0 +1,22 @@
import 'package:appwrite/appwrite.dart';
void main() { // Init SDK
Client client = Client();
Account account = Account(client);
client
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
.setProject('5df5acd0d48c2') // Your project ID
;
Future result = account.createOAuth2Session(
provider: 'amazon',
);
result
.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
}

View file

@ -0,0 +1,23 @@
import 'package:appwrite/appwrite.dart';
void main() { // Init SDK
Client client = Client();
Account account = Account(client);
client
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
.setProject('5df5acd0d48c2') // Your project ID
;
Future result = account.createRecovery(
email: 'email@example.com',
url: 'https://example.com',
);
result
.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
}

View file

@ -0,0 +1,23 @@
import 'package:appwrite/appwrite.dart';
void main() { // Init SDK
Client client = Client();
Account account = Account(client);
client
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
.setProject('5df5acd0d48c2') // Your project ID
;
Future result = account.createSession(
email: 'email@example.com',
password: 'password',
);
result
.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
}

View file

@ -0,0 +1,22 @@
import 'package:appwrite/appwrite.dart';
void main() { // Init SDK
Client client = Client();
Account account = Account(client);
client
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
.setProject('5df5acd0d48c2') // Your project ID
;
Future result = account.createVerification(
url: 'https://example.com',
);
result
.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
}

View file

@ -0,0 +1,23 @@
import 'package:appwrite/appwrite.dart';
void main() { // Init SDK
Client client = Client();
Account account = Account(client);
client
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
.setProject('5df5acd0d48c2') // Your project ID
;
Future result = account.create(
email: 'email@example.com',
password: 'password',
);
result
.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
}

View file

@ -0,0 +1,22 @@
import 'package:appwrite/appwrite.dart';
void main() { // Init SDK
Client client = Client();
Account account = Account(client);
client
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
.setProject('5df5acd0d48c2') // Your project ID
;
Future result = account.deleteSession(
sessionId: '[SESSION_ID]',
);
result
.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
}

View file

@ -0,0 +1,20 @@
import 'package:appwrite/appwrite.dart';
void main() { // Init SDK
Client client = Client();
Account account = Account(client);
client
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
.setProject('5df5acd0d48c2') // Your project ID
;
Future result = account.deleteSessions( );
result
.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
}

View file

@ -0,0 +1,20 @@
import 'package:appwrite/appwrite.dart';
void main() { // Init SDK
Client client = Client();
Account account = Account(client);
client
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
.setProject('5df5acd0d48c2') // Your project ID
;
Future result = account.delete( );
result
.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
}

View file

@ -0,0 +1,20 @@
import 'package:appwrite/appwrite.dart';
void main() { // Init SDK
Client client = Client();
Account account = Account(client);
client
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
.setProject('5df5acd0d48c2') // Your project ID
;
Future result = account.getLogs( );
result
.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
}

View file

@ -0,0 +1,20 @@
import 'package:appwrite/appwrite.dart';
void main() { // Init SDK
Client client = Client();
Account account = Account(client);
client
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
.setProject('5df5acd0d48c2') // Your project ID
;
Future result = account.getPrefs( );
result
.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
}

View file

@ -0,0 +1,20 @@
import 'package:appwrite/appwrite.dart';
void main() { // Init SDK
Client client = Client();
Account account = Account(client);
client
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
.setProject('5df5acd0d48c2') // Your project ID
;
Future result = account.getSessions( );
result
.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
}

View file

@ -0,0 +1,20 @@
import 'package:appwrite/appwrite.dart';
void main() { // Init SDK
Client client = Client();
Account account = Account(client);
client
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
.setProject('5df5acd0d48c2') // Your project ID
;
Future result = account.get( );
result
.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
}

View file

@ -0,0 +1,23 @@
import 'package:appwrite/appwrite.dart';
void main() { // Init SDK
Client client = Client();
Account account = Account(client);
client
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
.setProject('5df5acd0d48c2') // Your project ID
;
Future result = account.updateEmail(
email: 'email@example.com',
password: 'password',
);
result
.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
}

View file

@ -0,0 +1,22 @@
import 'package:appwrite/appwrite.dart';
void main() { // Init SDK
Client client = Client();
Account account = Account(client);
client
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
.setProject('5df5acd0d48c2') // Your project ID
;
Future result = account.updateName(
name: '[NAME]',
);
result
.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
}

View file

@ -0,0 +1,23 @@
import 'package:appwrite/appwrite.dart';
void main() { // Init SDK
Client client = Client();
Account account = Account(client);
client
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
.setProject('5df5acd0d48c2') // Your project ID
;
Future result = account.updatePassword(
password: 'password',
oldPassword: 'password',
);
result
.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
}

View file

@ -0,0 +1,22 @@
import 'package:appwrite/appwrite.dart';
void main() { // Init SDK
Client client = Client();
Account account = Account(client);
client
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
.setProject('5df5acd0d48c2') // Your project ID
;
Future result = account.updatePrefs(
prefs: {},
);
result
.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
}

View file

@ -0,0 +1,25 @@
import 'package:appwrite/appwrite.dart';
void main() { // Init SDK
Client client = Client();
Account account = Account(client);
client
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
.setProject('5df5acd0d48c2') // Your project ID
;
Future result = account.updateRecovery(
userId: '[USER_ID]',
secret: '[SECRET]',
password: 'password',
passwordAgain: 'password',
);
result
.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
}

View file

@ -0,0 +1,23 @@
import 'package:appwrite/appwrite.dart';
void main() { // Init SDK
Client client = Client();
Account account = Account(client);
client
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
.setProject('5df5acd0d48c2') // Your project ID
;
Future result = account.updateVerification(
userId: '[USER_ID]',
secret: '[SECRET]',
);
result
.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
}

View file

@ -0,0 +1,17 @@
import 'package:appwrite/appwrite.dart';
void main() { // Init SDK
Client client = Client();
Avatars avatars = Avatars(client);
client
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
.setProject('5df5acd0d48c2') // Your project ID
;
String result = avatars.getBrowser(
code: 'aa',
);
print(result); // Resource URL string
}

View file

@ -0,0 +1,17 @@
import 'package:appwrite/appwrite.dart';
void main() { // Init SDK
Client client = Client();
Avatars avatars = Avatars(client);
client
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
.setProject('5df5acd0d48c2') // Your project ID
;
String result = avatars.getCreditCard(
code: 'amex',
);
print(result); // Resource URL string
}

View file

@ -0,0 +1,17 @@
import 'package:appwrite/appwrite.dart';
void main() { // Init SDK
Client client = Client();
Avatars avatars = Avatars(client);
client
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
.setProject('5df5acd0d48c2') // Your project ID
;
String result = avatars.getFavicon(
url: 'https://example.com',
);
print(result); // Resource URL string
}

View file

@ -0,0 +1,17 @@
import 'package:appwrite/appwrite.dart';
void main() { // Init SDK
Client client = Client();
Avatars avatars = Avatars(client);
client
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
.setProject('5df5acd0d48c2') // Your project ID
;
String result = avatars.getFlag(
code: 'af',
);
print(result); // Resource URL string
}

View file

@ -0,0 +1,17 @@
import 'package:appwrite/appwrite.dart';
void main() { // Init SDK
Client client = Client();
Avatars avatars = Avatars(client);
client
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
.setProject('5df5acd0d48c2') // Your project ID
;
String result = avatars.getImage(
url: 'https://example.com',
);
print(result); // Resource URL string
}

View file

@ -0,0 +1,16 @@
import 'package:appwrite/appwrite.dart';
void main() { // Init SDK
Client client = Client();
Avatars avatars = Avatars(client);
client
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
.setProject('5df5acd0d48c2') // Your project ID
;
String result = avatars.getInitials(
);
print(result); // Resource URL string
}

View file

@ -0,0 +1,17 @@
import 'package:appwrite/appwrite.dart';
void main() { // Init SDK
Client client = Client();
Avatars avatars = Avatars(client);
client
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
.setProject('5df5acd0d48c2') // Your project ID
;
String result = avatars.getQR(
text: '[TEXT]',
);
print(result); // Resource URL string
}

View file

@ -0,0 +1,25 @@
import 'package:appwrite/appwrite.dart';
void main() { // Init SDK
Client client = Client();
Database database = Database(client);
client
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
.setProject('5df5acd0d48c2') // Your project ID
;
Future result = database.createDocument(
collectionId: '[COLLECTION_ID]',
data: {},
read: [],
write: [],
);
result
.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
}

View file

@ -0,0 +1,23 @@
import 'package:appwrite/appwrite.dart';
void main() { // Init SDK
Client client = Client();
Database database = Database(client);
client
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
.setProject('5df5acd0d48c2') // Your project ID
;
Future result = database.deleteDocument(
collectionId: '[COLLECTION_ID]',
documentId: '[DOCUMENT_ID]',
);
result
.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
}

View file

@ -0,0 +1,23 @@
import 'package:appwrite/appwrite.dart';
void main() { // Init SDK
Client client = Client();
Database database = Database(client);
client
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
.setProject('5df5acd0d48c2') // Your project ID
;
Future result = database.getDocument(
collectionId: '[COLLECTION_ID]',
documentId: '[DOCUMENT_ID]',
);
result
.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
}

View file

@ -0,0 +1,22 @@
import 'package:appwrite/appwrite.dart';
void main() { // Init SDK
Client client = Client();
Database database = Database(client);
client
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
.setProject('5df5acd0d48c2') // Your project ID
;
Future result = database.listDocuments(
collectionId: '[COLLECTION_ID]',
);
result
.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
}

View file

@ -0,0 +1,26 @@
import 'package:appwrite/appwrite.dart';
void main() { // Init SDK
Client client = Client();
Database database = Database(client);
client
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
.setProject('5df5acd0d48c2') // Your project ID
;
Future result = database.updateDocument(
collectionId: '[COLLECTION_ID]',
documentId: '[DOCUMENT_ID]',
data: {},
read: [],
write: [],
);
result
.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
}

View file

@ -0,0 +1,20 @@
import 'package:appwrite/appwrite.dart';
void main() { // Init SDK
Client client = Client();
Locale locale = Locale(client);
client
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
.setProject('5df5acd0d48c2') // Your project ID
;
Future result = locale.getContinents( );
result
.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
}

View file

@ -0,0 +1,20 @@
import 'package:appwrite/appwrite.dart';
void main() { // Init SDK
Client client = Client();
Locale locale = Locale(client);
client
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
.setProject('5df5acd0d48c2') // Your project ID
;
Future result = locale.getCountriesEU( );
result
.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
}

View file

@ -0,0 +1,20 @@
import 'package:appwrite/appwrite.dart';
void main() { // Init SDK
Client client = Client();
Locale locale = Locale(client);
client
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
.setProject('5df5acd0d48c2') // Your project ID
;
Future result = locale.getCountriesPhones( );
result
.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
}

View file

@ -0,0 +1,20 @@
import 'package:appwrite/appwrite.dart';
void main() { // Init SDK
Client client = Client();
Locale locale = Locale(client);
client
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
.setProject('5df5acd0d48c2') // Your project ID
;
Future result = locale.getCountries( );
result
.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
}

View file

@ -0,0 +1,20 @@
import 'package:appwrite/appwrite.dart';
void main() { // Init SDK
Client client = Client();
Locale locale = Locale(client);
client
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
.setProject('5df5acd0d48c2') // Your project ID
;
Future result = locale.getCurrencies( );
result
.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
}

View file

@ -0,0 +1,20 @@
import 'package:appwrite/appwrite.dart';
void main() { // Init SDK
Client client = Client();
Locale locale = Locale(client);
client
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
.setProject('5df5acd0d48c2') // Your project ID
;
Future result = locale.getLanguages( );
result
.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
}

View file

@ -0,0 +1,20 @@
import 'package:appwrite/appwrite.dart';
void main() { // Init SDK
Client client = Client();
Locale locale = Locale(client);
client
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
.setProject('5df5acd0d48c2') // Your project ID
;
Future result = locale.get( );
result
.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
}

View file

@ -0,0 +1,25 @@
import 'dart:io';
import 'package:appwrite/appwrite.dart';
void main() { // Init SDK
Client client = Client();
Storage storage = Storage(client);
client
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
.setProject('5df5acd0d48c2') // Your project ID
;
Future result = storage.createFile(
file: await MultipartFile.fromFile('./path-to-files/image.jpg', 'image.jpg'),
read: [],
write: [],
);
result
.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
}

View file

@ -0,0 +1,22 @@
import 'package:appwrite/appwrite.dart';
void main() { // Init SDK
Client client = Client();
Storage storage = Storage(client);
client
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
.setProject('5df5acd0d48c2') // Your project ID
;
Future result = storage.deleteFile(
fileId: '[FILE_ID]',
);
result
.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
}

View file

@ -0,0 +1,17 @@
import 'package:appwrite/appwrite.dart';
void main() { // Init SDK
Client client = Client();
Storage storage = Storage(client);
client
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
.setProject('5df5acd0d48c2') // Your project ID
;
String result = storage.getFileDownload(
fileId: '[FILE_ID]',
);
print(result); // Resource URL string
}

View file

@ -0,0 +1,17 @@
import 'package:appwrite/appwrite.dart';
void main() { // Init SDK
Client client = Client();
Storage storage = Storage(client);
client
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
.setProject('5df5acd0d48c2') // Your project ID
;
String result = storage.getFilePreview(
fileId: '[FILE_ID]',
);
print(result); // Resource URL string
}

View file

@ -0,0 +1,17 @@
import 'package:appwrite/appwrite.dart';
void main() { // Init SDK
Client client = Client();
Storage storage = Storage(client);
client
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
.setProject('5df5acd0d48c2') // Your project ID
;
String result = storage.getFileView(
fileId: '[FILE_ID]',
);
print(result); // Resource URL string
}

View file

@ -0,0 +1,22 @@
import 'package:appwrite/appwrite.dart';
void main() { // Init SDK
Client client = Client();
Storage storage = Storage(client);
client
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
.setProject('5df5acd0d48c2') // Your project ID
;
Future result = storage.getFile(
fileId: '[FILE_ID]',
);
result
.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
}

View file

@ -0,0 +1,21 @@
import 'package:appwrite/appwrite.dart';
void main() { // Init SDK
Client client = Client();
Storage storage = Storage(client);
client
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
.setProject('5df5acd0d48c2') // Your project ID
;
Future result = storage.listFiles(
);
result
.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
}

View file

@ -0,0 +1,24 @@
import 'package:appwrite/appwrite.dart';
void main() { // Init SDK
Client client = Client();
Storage storage = Storage(client);
client
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
.setProject('5df5acd0d48c2') // Your project ID
;
Future result = storage.updateFile(
fileId: '[FILE_ID]',
read: [],
write: [],
);
result
.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
}

View file

@ -0,0 +1,25 @@
import 'package:appwrite/appwrite.dart';
void main() { // Init SDK
Client client = Client();
Teams teams = Teams(client);
client
.setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
.setProject('5df5acd0d48c2') // Your project ID
;
Future result = teams.createMembership(
teamId: '[TEAM_ID]',
email: 'email@example.com',
roles: [],
url: 'https://example.com',
);
result
.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
}

Some files were not shown because too many files have changed in this diff Show more