diff --git a/tests/resources/functions/dart.tar.gz b/tests/resources/functions/dart.tar.gz index 31201c5fa..d444518a9 100644 Binary files a/tests/resources/functions/dart.tar.gz and b/tests/resources/functions/dart.tar.gz differ diff --git a/tests/resources/functions/dart/main.dart b/tests/resources/functions/dart/main.dart index 4006fc6ce..8dbe1aa70 100644 --- a/tests/resources/functions/dart/main.dart +++ b/tests/resources/functions/dart/main.dart @@ -1,26 +1,26 @@ -import 'dart:io'; -import 'package:dart_appwrite/dart_appwrite.dart'; +import "dart:io"; +import "package:dart_appwrite/dart_appwrite.dart"; void main() { // Init SDK Client client = Client(); client - .setEndpoint(process.env.APPWRITE_ENDPOINT) // Your API Endpoint - .setProject(process.env.APPWRITE_PROJECT) // Your project ID - .setKey(process.env.APPWRITE_SECRET) // Your secret API key + .setEndpoint(Platform.environment["APPWRITE_ENDPOINT"]) // Your API Endpoint + .setProject(Platform.environment["APPWRITE_PROJECT"]) // Your project ID + .setKey(Platform.environment["APPWRITE_SECRET"]) // Your secret API key ; Storage storage = Storage(client); //Future result = storage.getFile(fileId: '[FILE_ID]'); - print(process.env.APPWRITE_FUNCTION_ID); - print(process.env.APPWRITE_FUNCTION_NAME); - print(process.env.APPWRITE_FUNCTION_TAG); - print(process.env.APPWRITE_FUNCTION_TRIGGER); - print(process.env.APPWRITE_FUNCTION_ENV_NAME); - print(process.env.APPWRITE_FUNCTION_ENV_VERSION); + print(Platform.environment["APPWRITE_FUNCTION_ID"]); + print(Platform.environment["APPWRITE_FUNCTION_NAME"]); + print(Platform.environment["APPWRITE_FUNCTION_TAG"]); + print(Platform.environment["APPWRITE_FUNCTION_TRIGGER"]); + print(Platform.environment["APPWRITE_FUNCTION_ENV_NAME"]); + print(Platform.environment["APPWRITE_FUNCTION_ENV_VERSION"]); // print(result['$id']); - print(process.env.APPWRITE_FUNCTION_EVENT); - print(process.env.APPWRITE_FUNCTION_EVENT_PAYLOAD); + print(Platform.environment["APPWRITE_FUNCTION_EVENT"]); + print(Platform.environment["APPWRITE_FUNCTION_EVENT_PAYLOAD"]); } \ No newline at end of file diff --git a/tests/resources/functions/package-dart.sh b/tests/resources/functions/package-dart.sh index fb43d88a5..7da67fd64 100644 --- a/tests/resources/functions/package-dart.sh +++ b/tests/resources/functions/package-dart.sh @@ -3,7 +3,9 @@ echo 'Dart Packaging...' cp -r $(pwd)/tests/resources/functions/dart $(pwd)/tests/resources/functions/packages/dart +docker run --rm -v $(pwd)/tests/resources/functions/packages/dart:/app -w /app appwrite/env-dart-2.10:1.0.0 ls docker run --rm -v $(pwd)/tests/resources/functions/packages/dart:/app -w /app --env PUB_CACHE=./.appwrite appwrite/env-dart-2.10:1.0.0 pub get +docker run --rm -v $(pwd)/tests/resources/functions/packages/dart:/app -w /app --env PUB_CACHE=./.appwrite appwrite/env-dart-2.10:1.0.0 pub get --offline docker run --rm -v $(pwd)/tests/resources/functions/packages/dart:/app -w /app appwrite/env-dart-2.10:1.0.0 tar -zcvf code.tar.gz .