Release candidate for 1.5.x

This commit is contained in:
Jake Barnby
2024-02-27 20:33:14 +13:00
parent 4adba1f6ec
commit 1dacc5d3ef
99 changed files with 708 additions and 1225 deletions
+1 -1
View File
@@ -21,7 +21,7 @@ Add this to your package's `pubspec.yaml` file:
```yml
dependencies:
appwrite: ^12.0.0-rc.5
appwrite: ^12.0.0-rc.6
```
You can install packages from the command line:
+4 -11
View File
@@ -1,18 +1,11 @@
import 'package:appwrite/appwrite.dart';
Client client = Client()
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
Account account = Account(client);
Future result = account.addAuthenticator(
type: AuthenticatorType.totp,
MfaType result = await account.addAuthenticator(
type: AuthenticatorType.totp,
);
result.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
@@ -1,16 +1,9 @@
import 'package:appwrite/appwrite.dart';
Client client = Client()
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
Account account = Account(client);
Future result = account.createAnonymousSession();
result.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
Session result = await account.createAnonymousSession();
+4 -11
View File
@@ -1,18 +1,11 @@
import 'package:appwrite/appwrite.dart';
Client client = Client()
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
Account account = Account(client);
Future result = account.createChallenge(
factor: AuthenticationFactor.totp,
MfaChallenge result = await account.createChallenge(
factor: AuthenticationFactor.totp,
);
result.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
@@ -1,19 +1,12 @@
import 'package:appwrite/appwrite.dart';
Client client = Client()
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
Account account = Account(client);
Future result = account.createEmailPasswordSession(
email: 'email@example.com',
password: 'password',
Session result = await account.createEmailPasswordSession(
email: 'email@example.com',
password: 'password',
);
result.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
+6 -13
View File
@@ -1,20 +1,13 @@
import 'package:appwrite/appwrite.dart';
Client client = Client()
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
Account account = Account(client);
Future result = account.createEmailToken(
userId: '<USER_ID>',
email: 'email@example.com',
phrase: false, // (optional)
Token result = await account.createEmailToken(
userId: '<USER_ID>',
email: 'email@example.com',
phrase: false, // optional
);
result.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
+3 -10
View File
@@ -1,16 +1,9 @@
import 'package:appwrite/appwrite.dart';
Client client = Client()
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
Account account = Account(client);
Future result = account.createJWT();
result.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
Jwt result = await account.createJWT();
@@ -1,21 +1,14 @@
import 'package:appwrite/appwrite.dart';
Client client = Client()
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
Account account = Account(client);
Future result = account.createMagicURLToken(
userId: '<USER_ID>',
email: 'email@example.com',
url: 'https://example.com', // (optional)
phrase: false, // (optional)
Token result = await account.createMagicURLToken(
userId: '<USER_ID>',
email: 'email@example.com',
url: 'https://example.com', // optional
phrase: false, // optional
);
result.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
+7 -14
View File
@@ -1,21 +1,14 @@
import 'package:appwrite/appwrite.dart';
Client client = Client()
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
Account account = Account(client);
Future result = account.createOAuth2Session(
provider: OAuthProvider.amazon,
success: 'https://example.com', // (optional)
failure: 'https://example.com', // (optional)
scopes: [], // (optional)
await account.createOAuth2Session(
provider: OAuthProvider.amazon,
success: 'https://example.com', // optional
failure: 'https://example.com', // optional
scopes: [], // optional
);
result.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
+7 -14
View File
@@ -1,21 +1,14 @@
import 'package:appwrite/appwrite.dart';
Client client = Client()
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
Account account = Account(client);
Future result = account.createOAuth2Token(
provider: OAuthProvider.amazon,
success: 'https://example.com', // (optional)
failure: 'https://example.com', // (optional)
scopes: [], // (optional)
await account.createOAuth2Token(
provider: OAuthProvider.amazon,
success: 'https://example.com', // optional
failure: 'https://example.com', // optional
scopes: [], // optional
);
result.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
+5 -12
View File
@@ -1,19 +1,12 @@
import 'package:appwrite/appwrite.dart';
Client client = Client()
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
Account account = Account(client);
Future result = account.createPhoneToken(
userId: '<USER_ID>',
phone: '+12065550100',
Token result = await account.createPhoneToken(
userId: '<USER_ID>',
phone: '+12065550100',
);
result.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
@@ -1,16 +1,9 @@
import 'package:appwrite/appwrite.dart';
Client client = Client()
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
Account account = Account(client);
Future result = account.createPhoneVerification();
result.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
Token result = await account.createPhoneVerification();
+6 -13
View File
@@ -1,20 +1,13 @@
import 'package:appwrite/appwrite.dart';
Client client = Client()
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
Account account = Account(client);
Future result = account.createPushTarget(
targetId: '<TARGET_ID>',
identifier: '<IDENTIFIER>',
providerId: '<PROVIDER_ID>', // (optional)
Target result = await account.createPushTarget(
targetId: '<TARGET_ID>',
identifier: '<IDENTIFIER>',
providerId: '<PROVIDER_ID>', // optional
);
result.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
+5 -12
View File
@@ -1,19 +1,12 @@
import 'package:appwrite/appwrite.dart';
Client client = Client()
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
Account account = Account(client);
Future result = account.createRecovery(
email: 'email@example.com',
url: 'https://example.com',
Token result = await account.createRecovery(
email: 'email@example.com',
url: 'https://example.com',
);
result.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
+5 -12
View File
@@ -1,19 +1,12 @@
import 'package:appwrite/appwrite.dart';
Client client = Client()
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
Account account = Account(client);
Future result = account.createSession(
userId: '<USER_ID>',
secret: '<SECRET>',
Session result = await account.createSession(
userId: '<USER_ID>',
secret: '<SECRET>',
);
result.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
+4 -11
View File
@@ -1,18 +1,11 @@
import 'package:appwrite/appwrite.dart';
Client client = Client()
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
Account account = Account(client);
Future result = account.createVerification(
url: 'https://example.com',
Token result = await account.createVerification(
url: 'https://example.com',
);
result.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
+7 -14
View File
@@ -1,21 +1,14 @@
import 'package:appwrite/appwrite.dart';
Client client = Client()
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
Account account = Account(client);
Future result = account.create(
userId: '<USER_ID>',
email: 'email@example.com',
password: '',
name: '<NAME>', // (optional)
User result = await account.create(
userId: '<USER_ID>',
email: 'email@example.com',
password: '',
name: '<NAME>', // optional
);
result.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
+5 -12
View File
@@ -1,19 +1,12 @@
import 'package:appwrite/appwrite.dart';
Client client = Client()
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
Account account = Account(client);
Future result = account.deleteAuthenticator(
type: AuthenticatorType.totp,
otp: '<OTP>',
await account.deleteAuthenticator(
type: AuthenticatorType.totp,
otp: '<OTP>',
);
result.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
+4 -11
View File
@@ -1,18 +1,11 @@
import 'package:appwrite/appwrite.dart';
Client client = Client()
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
Account account = Account(client);
Future result = account.deleteIdentity(
identityId: '<IDENTITY_ID>',
await account.deleteIdentity(
identityId: '<IDENTITY_ID>',
);
result.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
+4 -11
View File
@@ -1,18 +1,11 @@
import 'package:appwrite/appwrite.dart';
Client client = Client()
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
Account account = Account(client);
Future result = account.deletePushTarget(
targetId: '<TARGET_ID>',
await account.deletePushTarget(
targetId: '<TARGET_ID>',
);
result.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
+4 -11
View File
@@ -1,18 +1,11 @@
import 'package:appwrite/appwrite.dart';
Client client = Client()
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
Account account = Account(client);
Future result = account.deleteSession(
sessionId: '<SESSION_ID>',
await account.deleteSession(
sessionId: '<SESSION_ID>',
);
result.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
+3 -10
View File
@@ -1,16 +1,9 @@
import 'package:appwrite/appwrite.dart';
Client client = Client()
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
Account account = Account(client);
Future result = account.deleteSessions();
result.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
await account.deleteSessions();
+3 -10
View File
@@ -1,16 +1,9 @@
import 'package:appwrite/appwrite.dart';
Client client = Client()
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
Account account = Account(client);
Future result = account.getPrefs();
result.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
Preferences result = await account.getPrefs();
+4 -11
View File
@@ -1,18 +1,11 @@
import 'package:appwrite/appwrite.dart';
Client client = Client()
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
Account account = Account(client);
Future result = account.getSession(
sessionId: '<SESSION_ID>',
Session result = await account.getSession(
sessionId: '<SESSION_ID>',
);
result.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
+3 -10
View File
@@ -1,16 +1,9 @@
import 'package:appwrite/appwrite.dart';
Client client = Client()
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
Account account = Account(client);
Future result = account.get();
result.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
User result = await account.get();
+3 -10
View File
@@ -1,16 +1,9 @@
import 'package:appwrite/appwrite.dart';
Client client = Client()
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
Account account = Account(client);
Future result = account.listFactors();
result.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
MfaFactors result = await account.listFactors();
+4 -11
View File
@@ -1,18 +1,11 @@
import 'package:appwrite/appwrite.dart';
Client client = Client()
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
Account account = Account(client);
Future result = account.listIdentities(
queries: [], // (optional)
IdentityList result = await account.listIdentities(
queries: [], // optional
);
result.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
+4 -11
View File
@@ -1,18 +1,11 @@
import 'package:appwrite/appwrite.dart';
Client client = Client()
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
Account account = Account(client);
Future result = account.listLogs(
queries: [], // (optional)
LogList result = await account.listLogs(
queries: [], // optional
);
result.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
+3 -10
View File
@@ -1,16 +1,9 @@
import 'package:appwrite/appwrite.dart';
Client client = Client()
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
Account account = Account(client);
Future result = account.listSessions();
result.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
SessionList result = await account.listSessions();
+5 -12
View File
@@ -1,19 +1,12 @@
import 'package:appwrite/appwrite.dart';
Client client = Client()
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
Account account = Account(client);
Future result = account.updateChallenge(
challengeId: '<CHALLENGE_ID>',
otp: '<OTP>',
result = await account.updateChallenge(
challengeId: '<CHALLENGE_ID>',
otp: '<OTP>',
);
result.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
+5 -12
View File
@@ -1,19 +1,12 @@
import 'package:appwrite/appwrite.dart';
Client client = Client()
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
Account account = Account(client);
Future result = account.updateEmail(
email: 'email@example.com',
password: 'password',
User result = await account.updateEmail(
email: 'email@example.com',
password: 'password',
);
result.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
+4 -11
View File
@@ -1,18 +1,11 @@
import 'package:appwrite/appwrite.dart';
Client client = Client()
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
Account account = Account(client);
Future result = account.updateMFA(
mfa: false,
User result = await account.updateMFA(
mfa: false,
);
result.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
@@ -1,19 +1,12 @@
import 'package:appwrite/appwrite.dart';
Client client = Client()
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
Account account = Account(client);
Future result = account.updateMagicURLSession(
userId: '<USER_ID>',
secret: '<SECRET>',
Session result = await account.updateMagicURLSession(
userId: '<USER_ID>',
secret: '<SECRET>',
);
result.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
+4 -11
View File
@@ -1,18 +1,11 @@
import 'package:appwrite/appwrite.dart';
Client client = Client()
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
Account account = Account(client);
Future result = account.updateName(
name: '<NAME>',
User result = await account.updateName(
name: '<NAME>',
);
result.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
+5 -12
View File
@@ -1,19 +1,12 @@
import 'package:appwrite/appwrite.dart';
Client client = Client()
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
Account account = Account(client);
Future result = account.updatePassword(
password: '',
oldPassword: 'password', // (optional)
User result = await account.updatePassword(
password: '',
oldPassword: 'password', // optional
);
result.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
@@ -0,0 +1,12 @@
import 'package:appwrite/appwrite.dart';
Client client = Client()
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
Account account = Account(client);
Session result = await account.updatePhoneSession(
userId: '<USER_ID>',
secret: '<SECRET>',
);
@@ -1,19 +1,12 @@
import 'package:appwrite/appwrite.dart';
Client client = Client()
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
Account account = Account(client);
Future result = account.updatePhoneVerification(
userId: '<USER_ID>',
secret: '<SECRET>',
Token result = await account.updatePhoneVerification(
userId: '<USER_ID>',
secret: '<SECRET>',
);
result.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
+5 -12
View File
@@ -1,19 +1,12 @@
import 'package:appwrite/appwrite.dart';
Client client = Client()
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
Account account = Account(client);
Future result = account.updatePhone(
phone: '+12065550100',
password: 'password',
User result = await account.updatePhone(
phone: '+12065550100',
password: 'password',
);
result.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
+4 -11
View File
@@ -1,18 +1,11 @@
import 'package:appwrite/appwrite.dart';
Client client = Client()
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
Account account = Account(client);
Future result = account.updatePrefs(
prefs: {},
User result = await account.updatePrefs(
prefs: {},
);
result.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
+5 -12
View File
@@ -1,19 +1,12 @@
import 'package:appwrite/appwrite.dart';
Client client = Client()
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
Account account = Account(client);
Future result = account.updatePushTarget(
targetId: '<TARGET_ID>',
identifier: '<IDENTIFIER>',
Target result = await account.updatePushTarget(
targetId: '<TARGET_ID>',
identifier: '<IDENTIFIER>',
);
result.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
+6 -13
View File
@@ -1,20 +1,13 @@
import 'package:appwrite/appwrite.dart';
Client client = Client()
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
Account account = Account(client);
Future result = account.updateRecovery(
userId: '<USER_ID>',
secret: '<SECRET>',
password: '',
Token result = await account.updateRecovery(
userId: '<USER_ID>',
secret: '<SECRET>',
password: '',
);
result.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
+4 -11
View File
@@ -1,18 +1,11 @@
import 'package:appwrite/appwrite.dart';
Client client = Client()
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
Account account = Account(client);
Future result = account.updateSession(
sessionId: '<SESSION_ID>',
Session result = await account.updateSession(
sessionId: '<SESSION_ID>',
);
result.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
+3 -10
View File
@@ -1,16 +1,9 @@
import 'package:appwrite/appwrite.dart';
Client client = Client()
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
Account account = Account(client);
Future result = account.updateStatus();
result.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
User result = await account.updateStatus();
+5 -12
View File
@@ -1,19 +1,12 @@
import 'package:appwrite/appwrite.dart';
Client client = Client()
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
Account account = Account(client);
Future result = account.updateVerification(
userId: '<USER_ID>',
secret: '<SECRET>',
Token result = await account.updateVerification(
userId: '<USER_ID>',
secret: '<SECRET>',
);
result.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
+5 -12
View File
@@ -1,19 +1,12 @@
import 'package:appwrite/appwrite.dart';
Client client = Client()
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
Account account = Account(client);
Future result = account.verifyAuthenticator(
type: AuthenticatorType.totp,
otp: '<OTP>',
User result = await account.verifyAuthenticator(
type: AuthenticatorType.totp,
otp: '<OTP>',
);
result.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
+21 -25
View File
@@ -1,37 +1,33 @@
import 'package:appwrite/appwrite.dart';
Client client = Client()
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
Avatars avatars = Avatars(client);
// Downloading file
Future result = avatars.getBrowser(
code: Browser.avantBrowser,
width: 0, // (optional)
height: 0, // (optional)
quality: 0, // (optional)
).then((bytes) {
final file = File('path_to_file/filename.ext');
file.writeAsBytesSync(bytes)
}).catchError((error) {
print(error.response);
})
UInt8List bytes = await avatars.getBrowser(
code: Browser.avantBrowser,
width: 0, // optional
height: 0, // optional
quality: 0, // optional
)
final file = File('path_to_file/filename.ext');
file.writeAsBytesSync(bytes);
// Displaying image preview
FutureBuilder(
future: avatars.getBrowser(
code: Browser.avantBrowser.value,
width:0 , // (optional)
height:0 , // (optional)
quality:0 , // (optional)
future: avatars.getBrowser(
code: Browser.avantBrowser,
width:0 , // optional
height:0 , // optional
quality:0 , // 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
? Image.memory(
snapshot.data,
)
: CircularProgressIndicator();
}
builder: (context, snapshot) {
return snapshot.hasData && snapshot.data != null
? Image.memory(snapshot.data)
: CircularProgressIndicator();
}
);
+21 -25
View File
@@ -1,37 +1,33 @@
import 'package:appwrite/appwrite.dart';
Client client = Client()
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
Avatars avatars = Avatars(client);
// Downloading file
Future result = avatars.getCreditCard(
code: CreditCard.americanExpress,
width: 0, // (optional)
height: 0, // (optional)
quality: 0, // (optional)
).then((bytes) {
final file = File('path_to_file/filename.ext');
file.writeAsBytesSync(bytes)
}).catchError((error) {
print(error.response);
})
UInt8List bytes = await avatars.getCreditCard(
code: CreditCard.americanExpress,
width: 0, // optional
height: 0, // optional
quality: 0, // optional
)
final file = File('path_to_file/filename.ext');
file.writeAsBytesSync(bytes);
// Displaying image preview
FutureBuilder(
future: avatars.getCreditCard(
code: CreditCard.americanExpress.value,
width:0 , // (optional)
height:0 , // (optional)
quality:0 , // (optional)
future: avatars.getCreditCard(
code: CreditCard.americanExpress,
width:0 , // optional
height:0 , // optional
quality:0 , // 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
? Image.memory(
snapshot.data,
)
: CircularProgressIndicator();
}
builder: (context, snapshot) {
return snapshot.hasData && snapshot.data != null
? Image.memory(snapshot.data)
: CircularProgressIndicator();
}
);
+15 -19
View File
@@ -1,31 +1,27 @@
import 'package:appwrite/appwrite.dart';
Client client = Client()
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
Avatars avatars = Avatars(client);
// Downloading file
Future result = avatars.getFavicon(
url: 'https://example.com',
).then((bytes) {
final file = File('path_to_file/filename.ext');
file.writeAsBytesSync(bytes)
}).catchError((error) {
print(error.response);
})
UInt8List bytes = await avatars.getFavicon(
url: 'https://example.com',
)
final file = File('path_to_file/filename.ext');
file.writeAsBytesSync(bytes);
// Displaying image preview
FutureBuilder(
future: avatars.getFavicon(
url:'https://example.com' ,
future: avatars.getFavicon(
url:'https://example.com' ,
), // 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
? Image.memory(
snapshot.data,
)
: CircularProgressIndicator();
}
builder: (context, snapshot) {
return snapshot.hasData && snapshot.data != null
? Image.memory(snapshot.data)
: CircularProgressIndicator();
}
);
+21 -25
View File
@@ -1,37 +1,33 @@
import 'package:appwrite/appwrite.dart';
Client client = Client()
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
Avatars avatars = Avatars(client);
// Downloading file
Future result = avatars.getFlag(
code: Flag.afghanistan,
width: 0, // (optional)
height: 0, // (optional)
quality: 0, // (optional)
).then((bytes) {
final file = File('path_to_file/filename.ext');
file.writeAsBytesSync(bytes)
}).catchError((error) {
print(error.response);
})
UInt8List bytes = await avatars.getFlag(
code: Flag.afghanistan,
width: 0, // optional
height: 0, // optional
quality: 0, // optional
)
final file = File('path_to_file/filename.ext');
file.writeAsBytesSync(bytes);
// Displaying image preview
FutureBuilder(
future: avatars.getFlag(
code: Flag.afghanistan.value,
width:0 , // (optional)
height:0 , // (optional)
quality:0 , // (optional)
future: avatars.getFlag(
code: Flag.afghanistan,
width:0 , // optional
height:0 , // optional
quality:0 , // 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
? Image.memory(
snapshot.data,
)
: CircularProgressIndicator();
}
builder: (context, snapshot) {
return snapshot.hasData && snapshot.data != null
? Image.memory(snapshot.data)
: CircularProgressIndicator();
}
);
+19 -23
View File
@@ -1,35 +1,31 @@
import 'package:appwrite/appwrite.dart';
Client client = Client()
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
Avatars avatars = Avatars(client);
// Downloading file
Future result = avatars.getImage(
url: 'https://example.com',
width: 0, // (optional)
height: 0, // (optional)
).then((bytes) {
final file = File('path_to_file/filename.ext');
file.writeAsBytesSync(bytes)
}).catchError((error) {
print(error.response);
})
UInt8List bytes = await avatars.getImage(
url: 'https://example.com',
width: 0, // optional
height: 0, // optional
)
final file = File('path_to_file/filename.ext');
file.writeAsBytesSync(bytes);
// Displaying image preview
FutureBuilder(
future: avatars.getImage(
url:'https://example.com' ,
width:0 , // (optional)
height:0 , // (optional)
future: avatars.getImage(
url:'https://example.com' ,
width:0 , // optional
height:0 , // 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
? Image.memory(
snapshot.data,
)
: CircularProgressIndicator();
}
builder: (context, snapshot) {
return snapshot.hasData && snapshot.data != null
? Image.memory(snapshot.data)
: CircularProgressIndicator();
}
);
+21 -25
View File
@@ -1,37 +1,33 @@
import 'package:appwrite/appwrite.dart';
Client client = Client()
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
Avatars avatars = Avatars(client);
// Downloading file
Future result = avatars.getInitials(
name: '<NAME>', // (optional)
width: 0, // (optional)
height: 0, // (optional)
background: '', // (optional)
).then((bytes) {
final file = File('path_to_file/filename.ext');
file.writeAsBytesSync(bytes)
}).catchError((error) {
print(error.response);
})
UInt8List bytes = await avatars.getInitials(
name: '<NAME>', // optional
width: 0, // optional
height: 0, // optional
background: '', // optional
)
final file = File('path_to_file/filename.ext');
file.writeAsBytesSync(bytes);
// Displaying image preview
FutureBuilder(
future: avatars.getInitials(
name:'<NAME>' , // (optional)
width:0 , // (optional)
height:0 , // (optional)
background:'' , // (optional)
future: avatars.getInitials(
name:'<NAME>' , // optional
width:0 , // optional
height:0 , // optional
background:'' , // 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
? Image.memory(
snapshot.data,
)
: CircularProgressIndicator();
}
builder: (context, snapshot) {
return snapshot.hasData && snapshot.data != null
? Image.memory(snapshot.data)
: CircularProgressIndicator();
}
);
+21 -25
View File
@@ -1,37 +1,33 @@
import 'package:appwrite/appwrite.dart';
Client client = Client()
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
Avatars avatars = Avatars(client);
// Downloading file
Future result = avatars.getQR(
text: '<TEXT>',
size: 1, // (optional)
margin: 0, // (optional)
download: false, // (optional)
).then((bytes) {
final file = File('path_to_file/filename.ext');
file.writeAsBytesSync(bytes)
}).catchError((error) {
print(error.response);
})
UInt8List bytes = await avatars.getQR(
text: '<TEXT>',
size: 1, // optional
margin: 0, // optional
download: false, // optional
)
final file = File('path_to_file/filename.ext');
file.writeAsBytesSync(bytes);
// Displaying image preview
FutureBuilder(
future: avatars.getQR(
text:'<TEXT>' ,
size:1 , // (optional)
margin:0 , // (optional)
download:false , // (optional)
future: avatars.getQR(
text:'<TEXT>' ,
size:1 , // optional
margin:0 , // optional
download:false , // 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
? Image.memory(
snapshot.data,
)
: CircularProgressIndicator();
}
builder: (context, snapshot) {
return snapshot.hasData && snapshot.data != null
? Image.memory(snapshot.data)
: CircularProgressIndicator();
}
);
+8 -15
View File
@@ -1,22 +1,15 @@
import 'package:appwrite/appwrite.dart';
Client client = Client()
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
Databases databases = Databases(client);
Future result = databases.createDocument(
databaseId: '<DATABASE_ID>',
collectionId: '<COLLECTION_ID>',
documentId: '<DOCUMENT_ID>',
data: {},
permissions: ["read("any")"], // (optional)
Document result = await databases.createDocument(
databaseId: '<DATABASE_ID>',
collectionId: '<COLLECTION_ID>',
documentId: '<DOCUMENT_ID>',
data: {},
permissions: ["read("any")"], // optional
);
result.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
+6 -13
View File
@@ -1,20 +1,13 @@
import 'package:appwrite/appwrite.dart';
Client client = Client()
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
Databases databases = Databases(client);
Future result = databases.deleteDocument(
databaseId: '<DATABASE_ID>',
collectionId: '<COLLECTION_ID>',
documentId: '<DOCUMENT_ID>',
await databases.deleteDocument(
databaseId: '<DATABASE_ID>',
collectionId: '<COLLECTION_ID>',
documentId: '<DOCUMENT_ID>',
);
result.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
+7 -14
View File
@@ -1,21 +1,14 @@
import 'package:appwrite/appwrite.dart';
Client client = Client()
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
Databases databases = Databases(client);
Future result = databases.getDocument(
databaseId: '<DATABASE_ID>',
collectionId: '<COLLECTION_ID>',
documentId: '<DOCUMENT_ID>',
queries: [], // (optional)
Document result = await databases.getDocument(
databaseId: '<DATABASE_ID>',
collectionId: '<COLLECTION_ID>',
documentId: '<DOCUMENT_ID>',
queries: [], // optional
);
result.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
+6 -13
View File
@@ -1,20 +1,13 @@
import 'package:appwrite/appwrite.dart';
Client client = Client()
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
Databases databases = Databases(client);
Future result = databases.listDocuments(
databaseId: '<DATABASE_ID>',
collectionId: '<COLLECTION_ID>',
queries: [], // (optional)
DocumentList result = await databases.listDocuments(
databaseId: '<DATABASE_ID>',
collectionId: '<COLLECTION_ID>',
queries: [], // optional
);
result.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
+8 -15
View File
@@ -1,22 +1,15 @@
import 'package:appwrite/appwrite.dart';
Client client = Client()
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
Databases databases = Databases(client);
Future result = databases.updateDocument(
databaseId: '<DATABASE_ID>',
collectionId: '<COLLECTION_ID>',
documentId: '<DOCUMENT_ID>',
data: {}, // (optional)
permissions: ["read("any")"], // (optional)
Document result = await databases.updateDocument(
databaseId: '<DATABASE_ID>',
collectionId: '<COLLECTION_ID>',
documentId: '<DOCUMENT_ID>',
data: {}, // optional
permissions: ["read("any")"], // optional
);
result.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
+9 -16
View File
@@ -1,23 +1,16 @@
import 'package:appwrite/appwrite.dart';
Client client = Client()
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
Functions functions = Functions(client);
Future result = functions.createExecution(
functionId: '<FUNCTION_ID>',
body: '<BODY>', // (optional)
xasync: false, // (optional)
path: '<PATH>', // (optional)
method: ExecutionMethod.gET, // (optional)
headers: {}, // (optional)
Execution result = await functions.createExecution(
functionId: '<FUNCTION_ID>',
body: '<BODY>', // optional
xasync: false, // optional
path: '<PATH>', // optional
method: ExecutionMethod.gET, // optional
headers: {}, // optional
);
result.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
+5 -12
View File
@@ -1,19 +1,12 @@
import 'package:appwrite/appwrite.dart';
Client client = Client()
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
Functions functions = Functions(client);
Future result = functions.getExecution(
functionId: '<FUNCTION_ID>',
executionId: '<EXECUTION_ID>',
Execution result = await functions.getExecution(
functionId: '<FUNCTION_ID>',
executionId: '<EXECUTION_ID>',
);
result.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
+6 -13
View File
@@ -1,20 +1,13 @@
import 'package:appwrite/appwrite.dart';
Client client = Client()
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
Functions functions = Functions(client);
Future result = functions.listExecutions(
functionId: '<FUNCTION_ID>',
queries: [], // (optional)
search: '<SEARCH>', // (optional)
ExecutionList result = await functions.listExecutions(
functionId: '<FUNCTION_ID>',
queries: [], // optional
search: '<SEARCH>', // optional
);
result.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
+4 -11
View File
@@ -1,18 +1,11 @@
import 'package:appwrite/appwrite.dart';
Client client = Client()
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
Graphql graphql = Graphql(client);
Future result = graphql.mutation(
query: {},
Any result = await graphql.mutation(
query: {},
);
result.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
+4 -11
View File
@@ -1,18 +1,11 @@
import 'package:appwrite/appwrite.dart';
Client client = Client()
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
Graphql graphql = Graphql(client);
Future result = graphql.query(
query: {},
Any result = await graphql.query(
query: {},
);
result.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
+3 -10
View File
@@ -1,16 +1,9 @@
import 'package:appwrite/appwrite.dart';
Client client = Client()
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
Locale locale = Locale(client);
Future result = locale.get();
result.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
Locale result = await locale.get();
+3 -10
View File
@@ -1,16 +1,9 @@
import 'package:appwrite/appwrite.dart';
Client client = Client()
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
Locale locale = Locale(client);
Future result = locale.listCodes();
result.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
LocaleCodeList result = await locale.listCodes();
+3 -10
View File
@@ -1,16 +1,9 @@
import 'package:appwrite/appwrite.dart';
Client client = Client()
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
Locale locale = Locale(client);
Future result = locale.listContinents();
result.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
ContinentList result = await locale.listContinents();
+3 -10
View File
@@ -1,16 +1,9 @@
import 'package:appwrite/appwrite.dart';
Client client = Client()
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
Locale locale = Locale(client);
Future result = locale.listCountriesEU();
result.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
CountryList result = await locale.listCountriesEU();
+3 -10
View File
@@ -1,16 +1,9 @@
import 'package:appwrite/appwrite.dart';
Client client = Client()
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
Locale locale = Locale(client);
Future result = locale.listCountriesPhones();
result.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
PhoneList result = await locale.listCountriesPhones();
+3 -10
View File
@@ -1,16 +1,9 @@
import 'package:appwrite/appwrite.dart';
Client client = Client()
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
Locale locale = Locale(client);
Future result = locale.listCountries();
result.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
CountryList result = await locale.listCountries();
+3 -10
View File
@@ -1,16 +1,9 @@
import 'package:appwrite/appwrite.dart';
Client client = Client()
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
Locale locale = Locale(client);
Future result = locale.listCurrencies();
result.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
CurrencyList result = await locale.listCurrencies();
+3 -10
View File
@@ -1,16 +1,9 @@
import 'package:appwrite/appwrite.dart';
Client client = Client()
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
Locale locale = Locale(client);
Future result = locale.listLanguages();
result.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
LanguageList result = await locale.listLanguages();
+6 -13
View File
@@ -1,20 +1,13 @@
import 'package:appwrite/appwrite.dart';
Client client = Client()
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
Messaging messaging = Messaging(client);
Future result = messaging.createSubscriber(
topicId: '<TOPIC_ID>',
subscriberId: '<SUBSCRIBER_ID>',
targetId: '<TARGET_ID>',
Subscriber result = await messaging.createSubscriber(
topicId: '<TOPIC_ID>',
subscriberId: '<SUBSCRIBER_ID>',
targetId: '<TARGET_ID>',
);
result.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
+5 -12
View File
@@ -1,19 +1,12 @@
import 'package:appwrite/appwrite.dart';
Client client = Client()
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
Messaging messaging = Messaging(client);
Future result = messaging.deleteSubscriber(
topicId: '<TOPIC_ID>',
subscriberId: '<SUBSCRIBER_ID>',
await messaging.deleteSubscriber(
topicId: '<TOPIC_ID>',
subscriberId: '<SUBSCRIBER_ID>',
);
result.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
+7 -14
View File
@@ -2,21 +2,14 @@ import 'dart:io';
import 'package:appwrite/appwrite.dart';
Client client = Client()
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
Storage storage = Storage(client);
Future result = storage.createFile(
bucketId: '<BUCKET_ID>',
fileId: '<FILE_ID>',
file: InputFile(path: './path-to-files/image.jpg', filename: 'image.jpg'),
permissions: ["read("any")"], // (optional)
File result = await storage.createFile(
bucketId: '<BUCKET_ID>',
fileId: '<FILE_ID>',
file: InputFile(path: './path-to-files/image.jpg', filename: 'image.jpg'),
permissions: ["read("any")"], // optional
);
result.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
+5 -12
View File
@@ -1,19 +1,12 @@
import 'package:appwrite/appwrite.dart';
Client client = Client()
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
Storage storage = Storage(client);
Future result = storage.deleteFile(
bucketId: '<BUCKET_ID>',
fileId: '<FILE_ID>',
await storage.deleteFile(
bucketId: '<BUCKET_ID>',
fileId: '<FILE_ID>',
);
result.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
+17 -21
View File
@@ -1,33 +1,29 @@
import 'package:appwrite/appwrite.dart';
Client client = Client()
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
Storage storage = Storage(client);
// Downloading file
Future result = storage.getFileDownload(
bucketId: '<BUCKET_ID>',
fileId: '<FILE_ID>',
).then((bytes) {
final file = File('path_to_file/filename.ext');
file.writeAsBytesSync(bytes)
}).catchError((error) {
print(error.response);
})
UInt8List bytes = await storage.getFileDownload(
bucketId: '<BUCKET_ID>',
fileId: '<FILE_ID>',
)
final file = File('path_to_file/filename.ext');
file.writeAsBytesSync(bytes);
// Displaying image preview
FutureBuilder(
future: storage.getFileDownload(
bucketId:'<BUCKET_ID>' ,
fileId:'<FILE_ID>' ,
future: storage.getFileDownload(
bucketId:'<BUCKET_ID>' ,
fileId:'<FILE_ID>' ,
), // 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
? Image.memory(
snapshot.data,
)
: CircularProgressIndicator();
}
builder: (context, snapshot) {
return snapshot.hasData && snapshot.data != null
? Image.memory(snapshot.data)
: CircularProgressIndicator();
}
);
+39 -43
View File
@@ -1,55 +1,51 @@
import 'package:appwrite/appwrite.dart';
Client client = Client()
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
Storage storage = Storage(client);
// Downloading file
Future result = storage.getFilePreview(
bucketId: '<BUCKET_ID>',
fileId: '<FILE_ID>',
width: 0, // (optional)
height: 0, // (optional)
gravity: ImageGravity.center, // (optional)
quality: 0, // (optional)
borderWidth: 0, // (optional)
borderColor: '', // (optional)
borderRadius: 0, // (optional)
opacity: 0, // (optional)
rotation: -360, // (optional)
background: '', // (optional)
output: ImageFormat.jpg, // (optional)
).then((bytes) {
final file = File('path_to_file/filename.ext');
file.writeAsBytesSync(bytes)
}).catchError((error) {
print(error.response);
})
UInt8List bytes = await storage.getFilePreview(
bucketId: '<BUCKET_ID>',
fileId: '<FILE_ID>',
width: 0, // optional
height: 0, // optional
gravity: ImageGravity.center, // optional
quality: 0, // optional
borderWidth: 0, // optional
borderColor: '', // optional
borderRadius: 0, // optional
opacity: 0, // optional
rotation: -360, // optional
background: '', // optional
output: ImageFormat.jpg, // optional
)
final file = File('path_to_file/filename.ext');
file.writeAsBytesSync(bytes);
// Displaying image preview
FutureBuilder(
future: storage.getFilePreview(
bucketId:'<BUCKET_ID>' ,
fileId:'<FILE_ID>' ,
width:0 , // (optional)
height:0 , // (optional)
gravity: ImageGravity.center.value, // (optional)
quality:0 , // (optional)
borderWidth:0 , // (optional)
borderColor:'' , // (optional)
borderRadius:0 , // (optional)
opacity:0 , // (optional)
rotation:-360 , // (optional)
background:'' , // (optional)
output: ImageFormat.jpg.value, // (optional)
future: storage.getFilePreview(
bucketId:'<BUCKET_ID>' ,
fileId:'<FILE_ID>' ,
width:0 , // optional
height:0 , // optional
gravity: ImageGravity.center, // optional
quality:0 , // optional
borderWidth:0 , // optional
borderColor:'' , // optional
borderRadius:0 , // optional
opacity:0 , // optional
rotation:-360 , // optional
background:'' , // optional
output: ImageFormat.jpg, // 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
? Image.memory(
snapshot.data,
)
: CircularProgressIndicator();
}
builder: (context, snapshot) {
return snapshot.hasData && snapshot.data != null
? Image.memory(snapshot.data)
: CircularProgressIndicator();
}
);
+17 -21
View File
@@ -1,33 +1,29 @@
import 'package:appwrite/appwrite.dart';
Client client = Client()
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
Storage storage = Storage(client);
// Downloading file
Future result = storage.getFileView(
bucketId: '<BUCKET_ID>',
fileId: '<FILE_ID>',
).then((bytes) {
final file = File('path_to_file/filename.ext');
file.writeAsBytesSync(bytes)
}).catchError((error) {
print(error.response);
})
UInt8List bytes = await storage.getFileView(
bucketId: '<BUCKET_ID>',
fileId: '<FILE_ID>',
)
final file = File('path_to_file/filename.ext');
file.writeAsBytesSync(bytes);
// Displaying image preview
FutureBuilder(
future: storage.getFileView(
bucketId:'<BUCKET_ID>' ,
fileId:'<FILE_ID>' ,
future: storage.getFileView(
bucketId:'<BUCKET_ID>' ,
fileId:'<FILE_ID>' ,
), // 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
? Image.memory(
snapshot.data,
)
: CircularProgressIndicator();
}
builder: (context, snapshot) {
return snapshot.hasData && snapshot.data != null
? Image.memory(snapshot.data)
: CircularProgressIndicator();
}
);
+5 -12
View File
@@ -1,19 +1,12 @@
import 'package:appwrite/appwrite.dart';
Client client = Client()
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
Storage storage = Storage(client);
Future result = storage.getFile(
bucketId: '<BUCKET_ID>',
fileId: '<FILE_ID>',
File result = await storage.getFile(
bucketId: '<BUCKET_ID>',
fileId: '<FILE_ID>',
);
result.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
+6 -13
View File
@@ -1,20 +1,13 @@
import 'package:appwrite/appwrite.dart';
Client client = Client()
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
Storage storage = Storage(client);
Future result = storage.listFiles(
bucketId: '<BUCKET_ID>',
queries: [], // (optional)
search: '<SEARCH>', // (optional)
FileList result = await storage.listFiles(
bucketId: '<BUCKET_ID>',
queries: [], // optional
search: '<SEARCH>', // optional
);
result.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
+7 -14
View File
@@ -1,21 +1,14 @@
import 'package:appwrite/appwrite.dart';
Client client = Client()
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
Storage storage = Storage(client);
Future result = storage.updateFile(
bucketId: '<BUCKET_ID>',
fileId: '<FILE_ID>',
name: '<NAME>', // (optional)
permissions: ["read("any")"], // (optional)
File result = await storage.updateFile(
bucketId: '<BUCKET_ID>',
fileId: '<FILE_ID>',
name: '<NAME>', // optional
permissions: ["read("any")"], // optional
);
result.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
+10 -17
View File
@@ -1,24 +1,17 @@
import 'package:appwrite/appwrite.dart';
Client client = Client()
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
Teams teams = Teams(client);
Future result = teams.createMembership(
teamId: '<TEAM_ID>',
roles: [],
email: 'email@example.com', // (optional)
userId: '<USER_ID>', // (optional)
phone: '+12065550100', // (optional)
url: 'https://example.com', // (optional)
name: '<NAME>', // (optional)
Membership result = await teams.createMembership(
teamId: '<TEAM_ID>',
roles: [],
email: 'email@example.com', // optional
userId: '<USER_ID>', // optional
phone: '+12065550100', // optional
url: 'https://example.com', // optional
name: '<NAME>', // optional
);
result.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
+6 -13
View File
@@ -1,20 +1,13 @@
import 'package:appwrite/appwrite.dart';
Client client = Client()
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
Teams teams = Teams(client);
Future result = teams.create(
teamId: '<TEAM_ID>',
name: '<NAME>',
roles: [], // (optional)
Team result = await teams.create(
teamId: '<TEAM_ID>',
name: '<NAME>',
roles: [], // optional
);
result.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
+5 -12
View File
@@ -1,19 +1,12 @@
import 'package:appwrite/appwrite.dart';
Client client = Client()
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
Teams teams = Teams(client);
Future result = teams.deleteMembership(
teamId: '<TEAM_ID>',
membershipId: '<MEMBERSHIP_ID>',
await teams.deleteMembership(
teamId: '<TEAM_ID>',
membershipId: '<MEMBERSHIP_ID>',
);
result.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
+4 -11
View File
@@ -1,18 +1,11 @@
import 'package:appwrite/appwrite.dart';
Client client = Client()
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
Teams teams = Teams(client);
Future result = teams.delete(
teamId: '<TEAM_ID>',
await teams.delete(
teamId: '<TEAM_ID>',
);
result.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
+5 -12
View File
@@ -1,19 +1,12 @@
import 'package:appwrite/appwrite.dart';
Client client = Client()
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
Teams teams = Teams(client);
Future result = teams.getMembership(
teamId: '<TEAM_ID>',
membershipId: '<MEMBERSHIP_ID>',
Membership result = await teams.getMembership(
teamId: '<TEAM_ID>',
membershipId: '<MEMBERSHIP_ID>',
);
result.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
+4 -11
View File
@@ -1,18 +1,11 @@
import 'package:appwrite/appwrite.dart';
Client client = Client()
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
Teams teams = Teams(client);
Future result = teams.getPrefs(
teamId: '<TEAM_ID>',
Preferences result = await teams.getPrefs(
teamId: '<TEAM_ID>',
);
result.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
+4 -11
View File
@@ -1,18 +1,11 @@
import 'package:appwrite/appwrite.dart';
Client client = Client()
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
Teams teams = Teams(client);
Future result = teams.get(
teamId: '<TEAM_ID>',
Team result = await teams.get(
teamId: '<TEAM_ID>',
);
result.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
+6 -13
View File
@@ -1,20 +1,13 @@
import 'package:appwrite/appwrite.dart';
Client client = Client()
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
Teams teams = Teams(client);
Future result = teams.listMemberships(
teamId: '<TEAM_ID>',
queries: [], // (optional)
search: '<SEARCH>', // (optional)
MembershipList result = await teams.listMemberships(
teamId: '<TEAM_ID>',
queries: [], // optional
search: '<SEARCH>', // optional
);
result.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
+5 -12
View File
@@ -1,19 +1,12 @@
import 'package:appwrite/appwrite.dart';
Client client = Client()
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
Teams teams = Teams(client);
Future result = teams.list(
queries: [], // (optional)
search: '<SEARCH>', // (optional)
TeamList result = await teams.list(
queries: [], // optional
search: '<SEARCH>', // optional
);
result.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
@@ -1,21 +1,14 @@
import 'package:appwrite/appwrite.dart';
Client client = Client()
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
Teams teams = Teams(client);
Future result = teams.updateMembershipStatus(
teamId: '<TEAM_ID>',
membershipId: '<MEMBERSHIP_ID>',
userId: '<USER_ID>',
secret: '<SECRET>',
Membership result = await teams.updateMembershipStatus(
teamId: '<TEAM_ID>',
membershipId: '<MEMBERSHIP_ID>',
userId: '<USER_ID>',
secret: '<SECRET>',
);
result.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
+6 -13
View File
@@ -1,20 +1,13 @@
import 'package:appwrite/appwrite.dart';
Client client = Client()
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
Teams teams = Teams(client);
Future result = teams.updateMembership(
teamId: '<TEAM_ID>',
membershipId: '<MEMBERSHIP_ID>',
roles: [],
Membership result = await teams.updateMembership(
teamId: '<TEAM_ID>',
membershipId: '<MEMBERSHIP_ID>',
roles: [],
);
result.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
+5 -12
View File
@@ -1,19 +1,12 @@
import 'package:appwrite/appwrite.dart';
Client client = Client()
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
Teams teams = Teams(client);
Future result = teams.updateName(
teamId: '<TEAM_ID>',
name: '<NAME>',
Team result = await teams.updateName(
teamId: '<TEAM_ID>',
name: '<NAME>',
);
result.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
+5 -12
View File
@@ -1,19 +1,12 @@
import 'package:appwrite/appwrite.dart';
Client client = Client()
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2'); // Your project ID
Teams teams = Teams(client);
Future result = teams.updatePrefs(
teamId: '<TEAM_ID>',
prefs: {},
Preferences result = await teams.updatePrefs(
teamId: '<TEAM_ID>',
prefs: {},
);
result.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
+39 -5
View File
@@ -166,6 +166,7 @@ class Account extends Service {
/// Update MFA
///
/// Enable or disable MFA on an account.
Future<models.User> updateMFA({required bool mfa}) async {
const String apiPath = '/account/mfa';
@@ -204,6 +205,7 @@ class Account extends Service {
/// Create MFA Challenge (confirmation)
///
/// Complete the MFA challenge by providing the one-time password.
Future updateChallenge({required String challengeId, required String otp}) async {
const String apiPath = '/account/mfa/challenge';
@@ -224,6 +226,7 @@ class Account extends Service {
/// List Factors
///
/// List the factors available on the account to be used as a MFA challange.
Future<models.MfaFactors> listFactors() async {
const String apiPath = '/account/mfa/factors';
@@ -242,6 +245,10 @@ class Account extends Service {
/// Add Authenticator
///
/// Add an authenticator app to be used as an MFA factor. Verify the
/// authenticator using the [verify
/// authenticator](/docs/references/cloud/client-web/account#verifyAuthenticator)
/// method.
Future<models.MfaType> addAuthenticator({required enums.AuthenticatorType type}) async {
final String apiPath = '/account/mfa/{type}'.replaceAll('{type}', type.value);
@@ -260,6 +267,9 @@ class Account extends Service {
/// Verify Authenticator
///
/// Verify an authenticator app after adding it using the [add
/// authenticator](/docs/references/cloud/client-web/account#addAuthenticator)
/// method.
Future<models.User> verifyAuthenticator({required enums.AuthenticatorType type, required String otp}) async {
final String apiPath = '/account/mfa/{type}'.replaceAll('{type}', type.value);
@@ -279,6 +289,7 @@ class Account extends Service {
/// Delete Authenticator
///
/// Delete an authenticator for a user by ID.
Future<models.User> deleteAuthenticator({required enums.AuthenticatorType type, required String otp}) async {
final String apiPath = '/account/mfa/{type}'.replaceAll('{type}', type.value);
@@ -555,7 +566,7 @@ class Account extends Service {
}
/// Create session (deprecated)
/// Update magic URL session
///
/// Use this endpoint to create a session from token. Provide the **userId**
/// and **secret** parameters from the successful response of authentication
@@ -631,6 +642,29 @@ class Account extends Service {
return client.webAuth(url, callbackUrlScheme: success);
}
/// Update phone session
///
/// Use this endpoint to create a session from token. Provide the **userId**
/// and **secret** parameters from the successful response of authentication
/// flows initiated by token creation. For example, magic URL and phone login.
Future<models.Session> updatePhoneSession({required String userId, required String secret}) async {
const String apiPath = '/account/sessions/phone';
final Map<String, dynamic> apiParams = {
'userId': userId,
'secret': secret,
};
final Map<String, String> apiHeaders = {
'content-type': 'application/json',
};
final res = await client.call(HttpMethod.put, path: apiPath, params: apiParams, headers: apiHeaders);
return models.Session.fromMap(res.data);
}
/// Create session
///
/// Use this endpoint to create a session from token. Provide the **userId**
@@ -674,7 +708,7 @@ class Account extends Service {
}
/// Update (or renew) a session
/// Update (or renew) session
///
/// Extend session's expiry to increase it's lifespan. Extending a session is
/// useful when session length is short such as 5 minutes.
@@ -738,7 +772,7 @@ class Account extends Service {
}
/// Create a push target
/// Create push target
///
Future<models.Target> createPushTarget({required String targetId, required String identifier, String? providerId}) async {
const String apiPath = '/account/targets/push';
@@ -759,7 +793,7 @@ class Account extends Service {
}
/// Update a push target
/// Update push target
///
Future<models.Target> updatePushTarget({required String targetId, required String identifier}) async {
final String apiPath = '/account/targets/{targetId}/push'.replaceAll('{targetId}', targetId);
@@ -778,7 +812,7 @@ class Account extends Service {
}
/// Delete a push target
/// Delete push target
///
Future deletePushTarget({required String targetId}) async {
final String apiPath = '/account/targets/{targetId}/push'.replaceAll('{targetId}', targetId);
+2 -2
View File
@@ -6,7 +6,7 @@ class Messaging extends Service {
/// Initializes a [Messaging] service
Messaging(super.client);
/// Create a subscriber
/// Create subscriber
///
/// Create a new subscriber.
Future<models.Subscriber> createSubscriber({required String topicId, required String subscriberId, required String targetId}) async {
@@ -27,7 +27,7 @@ class Messaging extends Service {
}
/// Delete a subscriber
/// Delete subscriber
///
/// Delete a subscriber by its unique ID.
Future deleteSubscriber({required String topicId, required String subscriberId}) async {
+1 -1
View File
@@ -43,7 +43,7 @@ class ClientBrowser extends ClientBase with ClientMixin {
'x-sdk-name': 'Flutter',
'x-sdk-platform': 'client',
'x-sdk-language': 'flutter',
'x-sdk-version': '12.0.0-rc.5',
'x-sdk-version': '12.0.0-rc.6',
'X-Appwrite-Response-Format': '1.5.0',
};
+1 -1
View File
@@ -64,7 +64,7 @@ class ClientIO extends ClientBase with ClientMixin {
'x-sdk-name': 'Flutter',
'x-sdk-platform': 'client',
'x-sdk-language': 'flutter',
'x-sdk-version': '12.0.0-rc.5',
'x-sdk-version': '12.0.0-rc.6',
'X-Appwrite-Response-Format' : '1.5.0',
};
+1 -1
View File
@@ -1,5 +1,5 @@
name: appwrite
version: 12.0.0-rc.5
version: 12.0.0-rc.6
description: Appwrite is an open-source self-hosted backend server that abstract and simplify complex and repetitive development tasks behind a very simple REST API
homepage: https://appwrite.io
repository: https://github.com/appwrite/sdk-for-flutter
+44
View File
@@ -756,6 +756,50 @@ void main() {
);
});
test('test method updatePhoneSession()', () async {
final Map<String, dynamic> data = {
'\$id': '5e5ea5c16897e',
'\$createdAt': '2020-10-15T06:38:00.000+00:00',
'userId': '5e5bb8c16897e',
'expire': '2020-10-15T06:38:00.000+00:00',
'provider': 'email',
'providerUid': 'user@example.com',
'providerAccessToken': 'MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3',
'providerAccessTokenExpiry': '2020-10-15T06:38:00.000+00:00',
'providerRefreshToken': 'MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3',
'ip': '127.0.0.1',
'osCode': 'Mac',
'osName': 'Mac',
'osVersion': 'Mac',
'clientType': 'browser',
'clientCode': 'CM',
'clientName': 'Chrome Mobile iOS',
'clientVersion': '84.0',
'clientEngine': 'WebKit',
'clientEngineVersion': '605.1.15',
'deviceName': 'smartphone',
'deviceBrand': 'Google',
'deviceModel': 'Nexus 5',
'countryCode': 'US',
'countryName': 'United States',
'current': true,
'factors': [],
'secret': '5e5bb8c16897e',};
when(client.call(
HttpMethod.put,
)).thenAnswer((_) async => Response(data: data));
final response = await account.updatePhoneSession(
userId: '<USER_ID>',
secret: '<SECRET>',
);
expect(response, isA<models.Session>());
});
test('test method createSession()', () async {
final Map<String, dynamic> data = {
'\$id': '5e5ea5c16897e',