I am calling a cloud function from the newest Flutter SDK 20.2.1with the xasync: false flag and get the result, but the execution.status is not a String and the ExecutionStatus Enum seems to not be importable:
final execution = await _functions.createExecution(
functionId: dotenv.get(
'APPWRITE_FUNC_CREATE_RESOURCES',
fallback: 'FUNCTION_ID not found',
),
body: json.encode(<String, dynamic>{
'email': email,
'password': password,
'name': name,
'storage': advanced,
}),
xasync: false,
);
debugPrint(
'Function execution status: ${execution.status} (type: ${execution.status.runtimeType})');
// debugPrint: Function execution status: ExecutionStatus.completed (type: ExecutionStatus)
if (execution.status == 'completed') {
// this is never reached because of a type mismatch
Am I doing something wrong here (I updated my flutter sdk version yesterday) or is this an issue? I tried importing it directly with import 'package:appwrite/enums.dart' as enums; but that didn't work as well.
I think I found it, the Enum structure was not shown in the pub.dev changelog for version 20.0.0 so I did not see any change there. I found the commit introducing Enums on GitHub and solved my implementation to
if (execution.status.value == 'completed') {
[SOLVED] Access ExecutionStatus of a function not a string
Recommended threads
- Functions in cloud console not works
please advise as all of my runing functions on Appwrite console was working before , but now it give this error [Invalid `headers` param: Value must be a valid...
- Production down - createExecution return...
Hey, Since 1.9.6 rollout in fra (~17:00 UTC, 14 Aug), POST /v1/functions/{functionId}/executions returns a 400 whenever the body includes an empty headers ob...
- CreateRow is doing ListRows on self-host...
### setup ``` appwrite 1.9.5 self-hosted bun 1.3 node-appwrite 27.1.0 ``` ### issue Im running a function on a self hosted 1.9.5 with "node-appwrite": "^27.1.0...