Hi,
I need to access an image file in my dart function. The file is in the lib folder just like the main.dart but all the paths I have tried didn't work like lib/image.png or just image.png. Any ideas? Thanks
I am sending an email with an attachment, the mailer package says to use File('/path/to/file') but the image is never included in the emails that get sent.
Hi - it needs to be in assets as made compulsory by Flutter, adding some source codes for reference: https://github.com/appwrite/awesome-appwrite#flutter
Hi. Thanks for the references but I can't seem to find what I'm looking for. Is there a specific example using a Dart function to access an asset? Thanks.
lemme check once
that assets stuff is for Flutter...I'm not even sure if you can have assets in a dart app...
oh ok. There has to be a way in dart to reference a file outside of the main.dart. I tried using File('lib/file.png') noting works. I guess because the path changes after the Function gets compiled?
I did a print statement in the code print(Directory.default.path) and after i looked at the execution logs i got back /usr/code-start
yes, we also compile the code and only move the executable over to the final runtime container for execution
Ok. Might just have to use node mailer instead. I just am way more comfortable with dart. š
maybe store your file in Appwrite storage?
Yes. That is an option also, and just reference the file from there.
Made it work using that method. Thanks.
[SOLVED] How to get an asset image in a Dart Function?
Recommended threads
- Empty listRows() response
Hi there, I'm shehryar, I'm new to react native and appwrite as well, I'm following a tutorial, what's surprising is the listRows({databaseId, tableId, queries}...
- Failed function deployments
I am using appwrite 1.8.0 (self hosted) and trying to manually deploy a python function. I am using appwrite from 0.x and went through multiple migrations. So ...
- Python-ml-3.12
Hi, when this runtime will be available for the cloud. I could see the runtimes repo has this added to Runtimes.php but I'm not able to use it to run locally or...