Assets
The Assets panel in Dreamflow is where you manage all the files your app needs, such as images, audio, videos, fonts, and documents. These assets are stored directly in your project, making them easy to reference and reuse across your app.
Right now you can only upload assets through the Asset Module. You cannot upload a file directly into the file tree in the code editor
Uploading Assets
To upload an asset, click Upload Assets and choose a file from your computer, or simply drag and drop it into the panel. Dreamflow will automatically organize the file into the right category (for example, a .png
will appear under Images). Additionally, Dreamflow will automatically add the asset to the pubspec.yaml
file within your project, so it's accessible throughout your application.
- You can use the search bar at the top of the Assets Panel to quickly locate files by name.
- Assets are bundled into your project when you publish or export the code.
Accessing Assets
Once uploaded, assets can be used directly through the Properties Panel or referenced in your generated code (for example: Image.asset('assets/images/logo.png')
).
Best Practices
- Optimize image sizes: Use lightweight formats like
.webp
or.svg
to improve performance and reduce load times. - Use clear, descriptive names: Give assets meaningful names (e.g.,
placeholder.png
instead ofimg1.png
) to make them easier to manage. - Avoid oversized files: Keep videos and audio files reasonably small to ensure your app remains fast and responsive.