mirror of
https://github.com/appwrite/sdk-for-flutter.git
synced 2026-04-07 19:27:41 +00:00
chore: release rc
This commit is contained in:
@@ -8,5 +8,4 @@ Account account = Account(client);
|
||||
|
||||
await account.deleteMfaAuthenticator(
|
||||
type: AuthenticatorType.totp,
|
||||
otp: '<OTP>',
|
||||
);
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
|
||||
Client client = Client()
|
||||
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
|
||||
.setProject('<YOUR_PROJECT_ID>'); // Your project ID
|
||||
|
||||
Functions functions = Functions(client);
|
||||
|
||||
// Downloading file
|
||||
UInt8List bytes = await functions.getDeploymentDownload(
|
||||
functionId: '<FUNCTION_ID>',
|
||||
deploymentId: '<DEPLOYMENT_ID>',
|
||||
)
|
||||
|
||||
final file = File('path_to_file/filename.ext');
|
||||
file.writeAsBytesSync(bytes);
|
||||
|
||||
// Displaying image preview
|
||||
FutureBuilder(
|
||||
future: functions.getDeploymentDownload(
|
||||
functionId:'<FUNCTION_ID>' ,
|
||||
deploymentId:'<DEPLOYMENT_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();
|
||||
}
|
||||
);
|
||||
@@ -0,0 +1,11 @@
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
|
||||
Client client = Client()
|
||||
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
|
||||
.setProject('<YOUR_PROJECT_ID>'); // Your project ID
|
||||
|
||||
Functions functions = Functions(client);
|
||||
|
||||
TemplateFunction result = await functions.getTemplate(
|
||||
templateId: '<TEMPLATE_ID>',
|
||||
);
|
||||
@@ -0,0 +1,14 @@
|
||||
import 'package:appwrite/appwrite.dart';
|
||||
|
||||
Client client = Client()
|
||||
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
|
||||
.setProject('<YOUR_PROJECT_ID>'); // Your project ID
|
||||
|
||||
Functions functions = Functions(client);
|
||||
|
||||
TemplateFunctionList result = await functions.listTemplates(
|
||||
runtimes: [], // optional
|
||||
useCases: [], // optional
|
||||
limit: 1, // optional
|
||||
offset: 0, // optional
|
||||
);
|
||||
Reference in New Issue
Block a user