mirror of
https://github.com/appwrite/sdk-for-flutter.git
synced 2026-04-07 19:27:41 +00:00
fix createMembership
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
```dart
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
|
||||
Client client = Client()
|
||||
@@ -7,3 +8,4 @@ Client client = Client()
|
||||
Account account = Account(client);
|
||||
|
||||
Session result = await account.createAnonymousSession();
|
||||
```
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
```dart
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
|
||||
Client client = Client()
|
||||
@@ -10,3 +11,4 @@ Session result = await account.createEmailPasswordSession(
|
||||
email: 'email@example.com',
|
||||
password: 'password',
|
||||
);
|
||||
```
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
```dart
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
|
||||
Client client = Client()
|
||||
@@ -11,3 +12,4 @@ Token result = await account.createEmailToken(
|
||||
email: 'email@example.com',
|
||||
phrase: false, // optional
|
||||
);
|
||||
```
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
```dart
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
|
||||
Client client = Client()
|
||||
@@ -9,3 +10,4 @@ Account account = Account(client);
|
||||
Token result = await account.createEmailVerification(
|
||||
url: 'https://example.com',
|
||||
);
|
||||
```
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
```dart
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
|
||||
Client client = Client()
|
||||
@@ -9,3 +10,4 @@ Account account = Account(client);
|
||||
Jwt result = await account.createJWT(
|
||||
duration: 0, // optional
|
||||
);
|
||||
```
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
```dart
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
|
||||
Client client = Client()
|
||||
@@ -12,3 +13,4 @@ Token result = await account.createMagicURLToken(
|
||||
url: 'https://example.com', // optional
|
||||
phrase: false, // optional
|
||||
);
|
||||
```
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
```dart
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
import 'package:appwrite/enums.dart' as enums;
|
||||
|
||||
Client client = Client()
|
||||
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
|
||||
@@ -9,3 +11,4 @@ Account account = Account(client);
|
||||
MfaType result = await account.createMFAAuthenticator(
|
||||
type: enums.AuthenticatorType.totp,
|
||||
);
|
||||
```
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
```dart
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
import 'package:appwrite/enums.dart' as enums;
|
||||
|
||||
Client client = Client()
|
||||
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
|
||||
@@ -9,3 +11,4 @@ Account account = Account(client);
|
||||
MfaChallenge result = await account.createMFAChallenge(
|
||||
factor: enums.AuthenticationFactor.email,
|
||||
);
|
||||
```
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
```dart
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
|
||||
Client client = Client()
|
||||
@@ -7,3 +8,4 @@ Client client = Client()
|
||||
Account account = Account(client);
|
||||
|
||||
MfaRecoveryCodes result = await account.createMFARecoveryCodes();
|
||||
```
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
```dart
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
import 'package:appwrite/enums.dart' as enums;
|
||||
|
||||
Client client = Client()
|
||||
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
|
||||
@@ -12,3 +14,4 @@ await account.createOAuth2Session(
|
||||
failure: 'https://example.com', // optional
|
||||
scopes: [], // optional
|
||||
);
|
||||
```
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
```dart
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
import 'package:appwrite/enums.dart' as enums;
|
||||
|
||||
Client client = Client()
|
||||
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
|
||||
@@ -12,3 +14,4 @@ await account.createOAuth2Token(
|
||||
failure: 'https://example.com', // optional
|
||||
scopes: [], // optional
|
||||
);
|
||||
```
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
```dart
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
|
||||
Client client = Client()
|
||||
@@ -10,3 +11,4 @@ Token result = await account.createPhoneToken(
|
||||
userId: '<USER_ID>',
|
||||
phone: '+12065550100',
|
||||
);
|
||||
```
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
```dart
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
|
||||
Client client = Client()
|
||||
@@ -7,3 +8,4 @@ Client client = Client()
|
||||
Account account = Account(client);
|
||||
|
||||
Token result = await account.createPhoneVerification();
|
||||
```
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
```dart
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
|
||||
Client client = Client()
|
||||
@@ -11,3 +12,4 @@ Target result = await account.createPushTarget(
|
||||
identifier: '<IDENTIFIER>',
|
||||
providerId: '<PROVIDER_ID>', // optional
|
||||
);
|
||||
```
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
```dart
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
|
||||
Client client = Client()
|
||||
@@ -10,3 +11,4 @@ Token result = await account.createRecovery(
|
||||
email: 'email@example.com',
|
||||
url: 'https://example.com',
|
||||
);
|
||||
```
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
```dart
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
|
||||
Client client = Client()
|
||||
@@ -10,3 +11,4 @@ Session result = await account.createSession(
|
||||
userId: '<USER_ID>',
|
||||
secret: '<SECRET>',
|
||||
);
|
||||
```
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
```dart
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
|
||||
Client client = Client()
|
||||
@@ -9,3 +10,4 @@ Account account = Account(client);
|
||||
Token result = await account.createVerification(
|
||||
url: 'https://example.com',
|
||||
);
|
||||
```
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
```dart
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
|
||||
Client client = Client()
|
||||
@@ -12,3 +13,4 @@ User result = await account.create(
|
||||
password: '',
|
||||
name: '<NAME>', // optional
|
||||
);
|
||||
```
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
```dart
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
|
||||
Client client = Client()
|
||||
@@ -9,3 +10,4 @@ Account account = Account(client);
|
||||
await account.deleteIdentity(
|
||||
identityId: '<IDENTITY_ID>',
|
||||
);
|
||||
```
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
```dart
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
import 'package:appwrite/enums.dart' as enums;
|
||||
|
||||
Client client = Client()
|
||||
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
|
||||
@@ -9,3 +11,4 @@ Account account = Account(client);
|
||||
await account.deleteMFAAuthenticator(
|
||||
type: enums.AuthenticatorType.totp,
|
||||
);
|
||||
```
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
```dart
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
|
||||
Client client = Client()
|
||||
@@ -9,3 +10,4 @@ Account account = Account(client);
|
||||
await account.deletePushTarget(
|
||||
targetId: '<TARGET_ID>',
|
||||
);
|
||||
```
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
```dart
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
|
||||
Client client = Client()
|
||||
@@ -9,3 +10,4 @@ Account account = Account(client);
|
||||
await account.deleteSession(
|
||||
sessionId: '<SESSION_ID>',
|
||||
);
|
||||
```
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
```dart
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
|
||||
Client client = Client()
|
||||
@@ -7,3 +8,4 @@ Client client = Client()
|
||||
Account account = Account(client);
|
||||
|
||||
await account.deleteSessions();
|
||||
```
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
```dart
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
|
||||
Client client = Client()
|
||||
@@ -7,3 +8,4 @@ Client client = Client()
|
||||
Account account = Account(client);
|
||||
|
||||
MfaRecoveryCodes result = await account.getMFARecoveryCodes();
|
||||
```
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
```dart
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
|
||||
Client client = Client()
|
||||
@@ -7,3 +8,4 @@ Client client = Client()
|
||||
Account account = Account(client);
|
||||
|
||||
Preferences result = await account.getPrefs();
|
||||
```
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
```dart
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
|
||||
Client client = Client()
|
||||
@@ -9,3 +10,4 @@ Account account = Account(client);
|
||||
Session result = await account.getSession(
|
||||
sessionId: '<SESSION_ID>',
|
||||
);
|
||||
```
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
```dart
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
|
||||
Client client = Client()
|
||||
@@ -7,3 +8,4 @@ Client client = Client()
|
||||
Account account = Account(client);
|
||||
|
||||
User result = await account.get();
|
||||
```
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
```dart
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
|
||||
Client client = Client()
|
||||
@@ -10,3 +11,4 @@ IdentityList result = await account.listIdentities(
|
||||
queries: [], // optional
|
||||
total: false, // optional
|
||||
);
|
||||
```
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
```dart
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
|
||||
Client client = Client()
|
||||
@@ -10,3 +11,4 @@ LogList result = await account.listLogs(
|
||||
queries: [], // optional
|
||||
total: false, // optional
|
||||
);
|
||||
```
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
```dart
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
|
||||
Client client = Client()
|
||||
@@ -7,3 +8,4 @@ Client client = Client()
|
||||
Account account = Account(client);
|
||||
|
||||
MfaFactors result = await account.listMFAFactors();
|
||||
```
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
```dart
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
|
||||
Client client = Client()
|
||||
@@ -7,3 +8,4 @@ Client client = Client()
|
||||
Account account = Account(client);
|
||||
|
||||
SessionList result = await account.listSessions();
|
||||
```
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
```dart
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
|
||||
Client client = Client()
|
||||
@@ -10,3 +11,4 @@ Token result = await account.updateEmailVerification(
|
||||
userId: '<USER_ID>',
|
||||
secret: '<SECRET>',
|
||||
);
|
||||
```
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
```dart
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
|
||||
Client client = Client()
|
||||
@@ -10,3 +11,4 @@ User result = await account.updateEmail(
|
||||
email: 'email@example.com',
|
||||
password: 'password',
|
||||
);
|
||||
```
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
```dart
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
|
||||
Client client = Client()
|
||||
@@ -10,3 +11,4 @@ Session result = await account.updateMagicURLSession(
|
||||
userId: '<USER_ID>',
|
||||
secret: '<SECRET>',
|
||||
);
|
||||
```
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
```dart
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
import 'package:appwrite/enums.dart' as enums;
|
||||
|
||||
Client client = Client()
|
||||
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
|
||||
@@ -10,3 +12,4 @@ User result = await account.updateMFAAuthenticator(
|
||||
type: enums.AuthenticatorType.totp,
|
||||
otp: '<OTP>',
|
||||
);
|
||||
```
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
```dart
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
|
||||
Client client = Client()
|
||||
@@ -10,3 +11,4 @@ Session result = await account.updateMFAChallenge(
|
||||
challengeId: '<CHALLENGE_ID>',
|
||||
otp: '<OTP>',
|
||||
);
|
||||
```
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
```dart
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
|
||||
Client client = Client()
|
||||
@@ -7,3 +8,4 @@ Client client = Client()
|
||||
Account account = Account(client);
|
||||
|
||||
MfaRecoveryCodes result = await account.updateMFARecoveryCodes();
|
||||
```
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
```dart
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
|
||||
Client client = Client()
|
||||
@@ -9,3 +10,4 @@ Account account = Account(client);
|
||||
User result = await account.updateMFA(
|
||||
mfa: false,
|
||||
);
|
||||
```
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
```dart
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
|
||||
Client client = Client()
|
||||
@@ -9,3 +10,4 @@ Account account = Account(client);
|
||||
User result = await account.updateName(
|
||||
name: '<NAME>',
|
||||
);
|
||||
```
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
```dart
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
|
||||
Client client = Client()
|
||||
@@ -10,3 +11,4 @@ User result = await account.updatePassword(
|
||||
password: '',
|
||||
oldPassword: 'password', // optional
|
||||
);
|
||||
```
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
```dart
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
|
||||
Client client = Client()
|
||||
@@ -10,3 +11,4 @@ Session result = await account.updatePhoneSession(
|
||||
userId: '<USER_ID>',
|
||||
secret: '<SECRET>',
|
||||
);
|
||||
```
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
```dart
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
|
||||
Client client = Client()
|
||||
@@ -10,3 +11,4 @@ Token result = await account.updatePhoneVerification(
|
||||
userId: '<USER_ID>',
|
||||
secret: '<SECRET>',
|
||||
);
|
||||
```
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
```dart
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
|
||||
Client client = Client()
|
||||
@@ -10,3 +11,4 @@ User result = await account.updatePhone(
|
||||
phone: '+12065550100',
|
||||
password: 'password',
|
||||
);
|
||||
```
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
```dart
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
|
||||
Client client = Client()
|
||||
@@ -13,3 +14,4 @@ User result = await account.updatePrefs(
|
||||
"darkTheme": true
|
||||
},
|
||||
);
|
||||
```
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
```dart
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
|
||||
Client client = Client()
|
||||
@@ -10,3 +11,4 @@ Target result = await account.updatePushTarget(
|
||||
targetId: '<TARGET_ID>',
|
||||
identifier: '<IDENTIFIER>',
|
||||
);
|
||||
```
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
```dart
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
|
||||
Client client = Client()
|
||||
@@ -11,3 +12,4 @@ Token result = await account.updateRecovery(
|
||||
secret: '<SECRET>',
|
||||
password: '',
|
||||
);
|
||||
```
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
```dart
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
|
||||
Client client = Client()
|
||||
@@ -9,3 +10,4 @@ Account account = Account(client);
|
||||
Session result = await account.updateSession(
|
||||
sessionId: '<SESSION_ID>',
|
||||
);
|
||||
```
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
```dart
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
|
||||
Client client = Client()
|
||||
@@ -7,3 +8,4 @@ Client client = Client()
|
||||
Account account = Account(client);
|
||||
|
||||
User result = await account.updateStatus();
|
||||
```
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
```dart
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
|
||||
Client client = Client()
|
||||
@@ -10,3 +11,4 @@ Token result = await account.updateVerification(
|
||||
userId: '<USER_ID>',
|
||||
secret: '<SECRET>',
|
||||
);
|
||||
```
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
```dart
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
import 'package:appwrite/enums.dart' as enums;
|
||||
|
||||
Client client = Client()
|
||||
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
|
||||
@@ -31,3 +33,4 @@ FutureBuilder(
|
||||
: CircularProgressIndicator();
|
||||
}
|
||||
);
|
||||
```
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
```dart
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
import 'package:appwrite/enums.dart' as enums;
|
||||
|
||||
Client client = Client()
|
||||
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
|
||||
@@ -31,3 +33,4 @@ FutureBuilder(
|
||||
: CircularProgressIndicator();
|
||||
}
|
||||
);
|
||||
```
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
```dart
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
|
||||
Client client = Client()
|
||||
@@ -25,3 +26,4 @@ FutureBuilder(
|
||||
: CircularProgressIndicator();
|
||||
}
|
||||
);
|
||||
```
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
```dart
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
import 'package:appwrite/enums.dart' as enums;
|
||||
|
||||
Client client = Client()
|
||||
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
|
||||
@@ -31,3 +33,4 @@ FutureBuilder(
|
||||
: CircularProgressIndicator();
|
||||
}
|
||||
);
|
||||
```
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
```dart
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
|
||||
Client client = Client()
|
||||
@@ -29,3 +30,4 @@ FutureBuilder(
|
||||
: CircularProgressIndicator();
|
||||
}
|
||||
);
|
||||
```
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
```dart
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
|
||||
Client client = Client()
|
||||
@@ -31,3 +32,4 @@ FutureBuilder(
|
||||
: CircularProgressIndicator();
|
||||
}
|
||||
);
|
||||
```
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
```dart
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
|
||||
Client client = Client()
|
||||
@@ -31,3 +32,4 @@ FutureBuilder(
|
||||
: CircularProgressIndicator();
|
||||
}
|
||||
);
|
||||
```
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
```dart
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
import 'package:appwrite/enums.dart' as enums;
|
||||
|
||||
Client client = Client()
|
||||
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
|
||||
@@ -69,3 +71,4 @@ FutureBuilder(
|
||||
: CircularProgressIndicator();
|
||||
}
|
||||
);
|
||||
```
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
```dart
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
import 'package:appwrite/permission.dart';
|
||||
import 'package:appwrite/role.dart';
|
||||
@@ -22,3 +23,4 @@ Document result = await databases.createDocument(
|
||||
permissions: [Permission.read(Role.any())], // optional
|
||||
transactionId: '<TRANSACTION_ID>', // optional
|
||||
);
|
||||
```
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
```dart
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
|
||||
Client client = Client()
|
||||
@@ -20,3 +21,4 @@ Transaction result = await databases.createOperations(
|
||||
}
|
||||
], // optional
|
||||
);
|
||||
```
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
```dart
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
|
||||
Client client = Client()
|
||||
@@ -9,3 +10,4 @@ Databases databases = Databases(client);
|
||||
Transaction result = await databases.createTransaction(
|
||||
ttl: 60, // optional
|
||||
);
|
||||
```
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
```dart
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
|
||||
Client client = Client()
|
||||
@@ -15,3 +16,4 @@ Document result = await databases.decrementDocumentAttribute(
|
||||
min: 0, // optional
|
||||
transactionId: '<TRANSACTION_ID>', // optional
|
||||
);
|
||||
```
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
```dart
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
|
||||
Client client = Client()
|
||||
@@ -12,3 +13,4 @@ await databases.deleteDocument(
|
||||
documentId: '<DOCUMENT_ID>',
|
||||
transactionId: '<TRANSACTION_ID>', // optional
|
||||
);
|
||||
```
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
```dart
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
|
||||
Client client = Client()
|
||||
@@ -9,3 +10,4 @@ Databases databases = Databases(client);
|
||||
await databases.deleteTransaction(
|
||||
transactionId: '<TRANSACTION_ID>',
|
||||
);
|
||||
```
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
```dart
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
|
||||
Client client = Client()
|
||||
@@ -13,3 +14,4 @@ Document result = await databases.getDocument(
|
||||
queries: [], // optional
|
||||
transactionId: '<TRANSACTION_ID>', // optional
|
||||
);
|
||||
```
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
```dart
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
|
||||
Client client = Client()
|
||||
@@ -9,3 +10,4 @@ Databases databases = Databases(client);
|
||||
Transaction result = await databases.getTransaction(
|
||||
transactionId: '<TRANSACTION_ID>',
|
||||
);
|
||||
```
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
```dart
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
|
||||
Client client = Client()
|
||||
@@ -15,3 +16,4 @@ Document result = await databases.incrementDocumentAttribute(
|
||||
max: 0, // optional
|
||||
transactionId: '<TRANSACTION_ID>', // optional
|
||||
);
|
||||
```
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
```dart
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
|
||||
Client client = Client()
|
||||
@@ -13,3 +14,4 @@ DocumentList result = await databases.listDocuments(
|
||||
transactionId: '<TRANSACTION_ID>', // optional
|
||||
total: false, // optional
|
||||
);
|
||||
```
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
```dart
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
|
||||
Client client = Client()
|
||||
@@ -9,3 +10,4 @@ Databases databases = Databases(client);
|
||||
TransactionList result = await databases.listTransactions(
|
||||
queries: [], // optional
|
||||
);
|
||||
```
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
```dart
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
import 'package:appwrite/permission.dart';
|
||||
import 'package:appwrite/role.dart';
|
||||
@@ -22,3 +23,4 @@ Document result = await databases.updateDocument(
|
||||
permissions: [Permission.read(Role.any())], // optional
|
||||
transactionId: '<TRANSACTION_ID>', // optional
|
||||
);
|
||||
```
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
```dart
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
|
||||
Client client = Client()
|
||||
@@ -11,3 +12,4 @@ Transaction result = await databases.updateTransaction(
|
||||
commit: false, // optional
|
||||
rollback: false, // optional
|
||||
);
|
||||
```
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
```dart
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
import 'package:appwrite/permission.dart';
|
||||
import 'package:appwrite/role.dart';
|
||||
@@ -22,3 +23,4 @@ Document result = await databases.upsertDocument(
|
||||
permissions: [Permission.read(Role.any())], // optional
|
||||
transactionId: '<TRANSACTION_ID>', // optional
|
||||
);
|
||||
```
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
```dart
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
import 'package:appwrite/enums.dart' as enums;
|
||||
|
||||
Client client = Client()
|
||||
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
|
||||
@@ -15,3 +17,4 @@ Execution result = await functions.createExecution(
|
||||
headers: {}, // optional
|
||||
scheduledAt: '<SCHEDULED_AT>', // optional
|
||||
);
|
||||
```
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
```dart
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
|
||||
Client client = Client()
|
||||
@@ -10,3 +11,4 @@ Execution result = await functions.getExecution(
|
||||
functionId: '<FUNCTION_ID>',
|
||||
executionId: '<EXECUTION_ID>',
|
||||
);
|
||||
```
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
```dart
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
|
||||
Client client = Client()
|
||||
@@ -11,3 +12,4 @@ ExecutionList result = await functions.listExecutions(
|
||||
queries: [], // optional
|
||||
total: false, // optional
|
||||
);
|
||||
```
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
```dart
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
|
||||
Client client = Client()
|
||||
@@ -9,3 +10,4 @@ Graphql graphql = Graphql(client);
|
||||
Any result = await graphql.mutation(
|
||||
query: {},
|
||||
);
|
||||
```
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
```dart
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
|
||||
Client client = Client()
|
||||
@@ -9,3 +10,4 @@ Graphql graphql = Graphql(client);
|
||||
Any result = await graphql.query(
|
||||
query: {},
|
||||
);
|
||||
```
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
```dart
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
|
||||
Client client = Client()
|
||||
@@ -7,3 +8,4 @@ Client client = Client()
|
||||
Locale locale = Locale(client);
|
||||
|
||||
Locale result = await locale.get();
|
||||
```
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
```dart
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
|
||||
Client client = Client()
|
||||
@@ -7,3 +8,4 @@ Client client = Client()
|
||||
Locale locale = Locale(client);
|
||||
|
||||
LocaleCodeList result = await locale.listCodes();
|
||||
```
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
```dart
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
|
||||
Client client = Client()
|
||||
@@ -7,3 +8,4 @@ Client client = Client()
|
||||
Locale locale = Locale(client);
|
||||
|
||||
ContinentList result = await locale.listContinents();
|
||||
```
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
```dart
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
|
||||
Client client = Client()
|
||||
@@ -7,3 +8,4 @@ Client client = Client()
|
||||
Locale locale = Locale(client);
|
||||
|
||||
CountryList result = await locale.listCountriesEU();
|
||||
```
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
```dart
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
|
||||
Client client = Client()
|
||||
@@ -7,3 +8,4 @@ Client client = Client()
|
||||
Locale locale = Locale(client);
|
||||
|
||||
PhoneList result = await locale.listCountriesPhones();
|
||||
```
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
```dart
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
|
||||
Client client = Client()
|
||||
@@ -7,3 +8,4 @@ Client client = Client()
|
||||
Locale locale = Locale(client);
|
||||
|
||||
CountryList result = await locale.listCountries();
|
||||
```
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
```dart
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
|
||||
Client client = Client()
|
||||
@@ -7,3 +8,4 @@ Client client = Client()
|
||||
Locale locale = Locale(client);
|
||||
|
||||
CurrencyList result = await locale.listCurrencies();
|
||||
```
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
```dart
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
|
||||
Client client = Client()
|
||||
@@ -7,3 +8,4 @@ Client client = Client()
|
||||
Locale locale = Locale(client);
|
||||
|
||||
LanguageList result = await locale.listLanguages();
|
||||
```
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
```dart
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
|
||||
Client client = Client()
|
||||
@@ -11,3 +12,4 @@ Subscriber result = await messaging.createSubscriber(
|
||||
subscriberId: '<SUBSCRIBER_ID>',
|
||||
targetId: '<TARGET_ID>',
|
||||
);
|
||||
```
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
```dart
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
|
||||
Client client = Client()
|
||||
@@ -10,3 +11,4 @@ await messaging.deleteSubscriber(
|
||||
topicId: '<TOPIC_ID>',
|
||||
subscriberId: '<SUBSCRIBER_ID>',
|
||||
);
|
||||
```
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
```dart
|
||||
import 'dart:io';
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
import 'package:appwrite/permission.dart';
|
||||
@@ -15,3 +16,4 @@ File result = await storage.createFile(
|
||||
file: InputFile(path: './path-to-files/image.jpg', filename: 'image.jpg'),
|
||||
permissions: [Permission.read(Role.any())], // optional
|
||||
);
|
||||
```
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
```dart
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
|
||||
Client client = Client()
|
||||
@@ -10,3 +11,4 @@ await storage.deleteFile(
|
||||
bucketId: '<BUCKET_ID>',
|
||||
fileId: '<FILE_ID>',
|
||||
);
|
||||
```
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
```dart
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
|
||||
Client client = Client()
|
||||
@@ -29,3 +30,4 @@ FutureBuilder(
|
||||
: CircularProgressIndicator();
|
||||
}
|
||||
);
|
||||
```
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
```dart
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
import 'package:appwrite/enums.dart' as enums;
|
||||
|
||||
Client client = Client()
|
||||
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
|
||||
@@ -51,3 +53,4 @@ FutureBuilder(
|
||||
: CircularProgressIndicator();
|
||||
}
|
||||
);
|
||||
```
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
```dart
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
|
||||
Client client = Client()
|
||||
@@ -29,3 +30,4 @@ FutureBuilder(
|
||||
: CircularProgressIndicator();
|
||||
}
|
||||
);
|
||||
```
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
```dart
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
|
||||
Client client = Client()
|
||||
@@ -10,3 +11,4 @@ File result = await storage.getFile(
|
||||
bucketId: '<BUCKET_ID>',
|
||||
fileId: '<FILE_ID>',
|
||||
);
|
||||
```
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
```dart
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
|
||||
Client client = Client()
|
||||
@@ -12,3 +13,4 @@ FileList result = await storage.listFiles(
|
||||
search: '<SEARCH>', // optional
|
||||
total: false, // optional
|
||||
);
|
||||
```
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
```dart
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
import 'package:appwrite/permission.dart';
|
||||
import 'package:appwrite/role.dart';
|
||||
@@ -14,3 +15,4 @@ File result = await storage.updateFile(
|
||||
name: '<NAME>', // optional
|
||||
permissions: [Permission.read(Role.any())], // optional
|
||||
);
|
||||
```
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
```dart
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
|
||||
Client client = Client()
|
||||
@@ -20,3 +21,4 @@ Transaction result = await tablesDB.createOperations(
|
||||
}
|
||||
], // optional
|
||||
);
|
||||
```
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
```dart
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
import 'package:appwrite/permission.dart';
|
||||
import 'package:appwrite/role.dart';
|
||||
@@ -22,3 +23,4 @@ Row result = await tablesDB.createRow(
|
||||
permissions: [Permission.read(Role.any())], // optional
|
||||
transactionId: '<TRANSACTION_ID>', // optional
|
||||
);
|
||||
```
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
```dart
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
|
||||
Client client = Client()
|
||||
@@ -9,3 +10,4 @@ TablesDB tablesDB = TablesDB(client);
|
||||
Transaction result = await tablesDB.createTransaction(
|
||||
ttl: 60, // optional
|
||||
);
|
||||
```
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
```dart
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
|
||||
Client client = Client()
|
||||
@@ -15,3 +16,4 @@ Row result = await tablesDB.decrementRowColumn(
|
||||
min: 0, // optional
|
||||
transactionId: '<TRANSACTION_ID>', // optional
|
||||
);
|
||||
```
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
```dart
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
|
||||
Client client = Client()
|
||||
@@ -12,3 +13,4 @@ await tablesDB.deleteRow(
|
||||
rowId: '<ROW_ID>',
|
||||
transactionId: '<TRANSACTION_ID>', // optional
|
||||
);
|
||||
```
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
```dart
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
|
||||
Client client = Client()
|
||||
@@ -9,3 +10,4 @@ TablesDB tablesDB = TablesDB(client);
|
||||
await tablesDB.deleteTransaction(
|
||||
transactionId: '<TRANSACTION_ID>',
|
||||
);
|
||||
```
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user