|
| 1 | +--- |
| 2 | +slug: /workspace/assets |
| 3 | +title: Assets |
| 4 | +description: Discover how to manage images, audio, fonts, and other files in Dreamflow’s Assets panel. |
| 5 | +tags: [assets, dreamflow, flutter] |
| 6 | +keywords: [assets panel, flutter assets, image management, audio files, font files, resource organization, dreamflow workspace, asset upload, asset usage] |
| 7 | +sidebar_position: 3 |
| 8 | +--- |
| 9 | + |
| 10 | +# Assets |
| 11 | + |
| 12 | +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. |
| 13 | + |
| 14 | +## Uploading Assets |
| 15 | + |
| 16 | +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**). |
| 17 | + |
| 18 | +:::info |
| 19 | + |
| 20 | +- You can use the search bar at the top of the Assets Panel to quickly locate files by name. |
| 21 | +- Assets are bundled into your project when you publish or export the code. |
| 22 | + |
| 23 | +::: |
| 24 | + |
| 25 | + |
| 26 | +<div style={{ |
| 27 | + position: 'relative', |
| 28 | + paddingBottom: 'calc(52.67989417989418% + 41px)', // Keeps the aspect ratio and additional padding |
| 29 | + height: 0, |
| 30 | + width: '100%'}}> |
| 31 | + <iframe |
| 32 | + src="https://demo.arcade.software/j9xa6jssFU7pazeWHvNe?embed&show_copy_link=true" |
| 33 | + title="" |
| 34 | + style={{ |
| 35 | + position: 'absolute', |
| 36 | + top: 0, |
| 37 | + left: 0, |
| 38 | + width: '100%', |
| 39 | + height: '100%', |
| 40 | + colorScheme: 'light' |
| 41 | + }} |
| 42 | + frameborder="0" |
| 43 | + loading="lazy" |
| 44 | + webkitAllowFullScreen |
| 45 | + mozAllowFullScreen |
| 46 | + allowFullScreen |
| 47 | + allow="clipboard-write"> |
| 48 | + </iframe> |
| 49 | +</div> |
| 50 | +<p></p> |
| 51 | + |
| 52 | + |
| 53 | +## Accessing Assets |
| 54 | + |
| 55 | +Once uploaded, assets can be used directly through the [Properties Panel](../properties-panel.md) or referenced in your generated code (for example: `Image.asset('assets/images/logo.png')`). |
| 56 | + |
| 57 | + |
| 58 | +<div style={{ |
| 59 | + position: 'relative', |
| 60 | + paddingBottom: 'calc(52.67989417989418% + 41px)', // Keeps the aspect ratio and additional padding |
| 61 | + height: 0, |
| 62 | + width: '100%'}}> |
| 63 | + <iframe |
| 64 | + src="https://demo.arcade.software/4knXrPcj8X2PWRMp5DGx?embed&show_copy_link=true" |
| 65 | + title="" |
| 66 | + style={{ |
| 67 | + position: 'absolute', |
| 68 | + top: 0, |
| 69 | + left: 0, |
| 70 | + width: '100%', |
| 71 | + height: '100%', |
| 72 | + colorScheme: 'light' |
| 73 | + }} |
| 74 | + frameborder="0" |
| 75 | + loading="lazy" |
| 76 | + webkitAllowFullScreen |
| 77 | + mozAllowFullScreen |
| 78 | + allowFullScreen |
| 79 | + allow="clipboard-write"> |
| 80 | + </iframe> |
| 81 | +</div> |
| 82 | +<p></p> |
| 83 | + |
| 84 | + |
| 85 | +## Best Practices |
| 86 | + |
| 87 | +- **Optimize image sizes:** Use lightweight formats like `.webp` or `.svg` to improve performance and reduce load times. |
| 88 | +- **Use clear, descriptive names:** Give assets meaningful names (e.g., `placeholder.png` instead of `img1.png`) to make them easier to manage. |
| 89 | +- **Avoid oversized files:** Keep videos and audio files reasonably small to ensure your app remains fast and responsive. |
0 commit comments