FlutterFlow / flutterflow-issues

A community issue tracker for FlutterFlow.
121 stars 18 forks source link

Referring to image assets from custom code is not working #3799

Open ercanyuz opened 1 month ago

ercanyuz commented 1 month ago

Can we access your project?

Current Behavior

When I insert in image with an Image widget statically, it works fine. When I refer them from a custom code via Image.asset('assets/images/us.png'), it works on the local run but not on the server.

Expected Behavior

Image should be loaded on server just like it does with local run.

Steps to Reproduce

  1. Create a blank project

  2. Upload an image to assets

  3. Insert the image statically via Image widget with type "Asset" (to make sure it's there)

  4. Create a custom widget that refers to the same image via Image.asset('assets/images/us.png')

  5. Insert the custom widget

  6. Enable this in App settings:

    image
  7. Test with local run (success)

  8. Test on the server (fail)

Test Project: https://app.flutterflow.io/project/image-assets-test-p2eoq4

Reproducible from Blank

Bug Report Code (Required)

IT4Oj8nlz5F2pbxY1872dcdKgSQRNlw1bZZMlcJEdw4aG4vNG7UIec/4VEptXbC+TVc3M2GkpHwx7srIuObIN/AqBwiZfoQ7+ZBqYTnzd3yhaYShELmKf3wnINpKCBGv0baS3BUlXLBZL2AD2E6mfPPKaD3vO4z2O3oRAPH9Kt/MnXPuQ0SLb3kNh1JWeC/v

Visual documentation

Local run:

image

Server:

image

Generated Code of the static Image widget:

image

Code of Custom Widget (refers to the image exactly the same way as the Image widget does):

image

Environment

- FlutterFlow version: FlutterFlow v4.1.90 released September 10, 2024
Flutter version is 3.22.2
- Platform: Web
- Browser name and version: Chrome 128.0.6613.120 (Official Build) (arm64)
- Operating system and version affected: MacOS 14.6 (23G80)

Additional Information

No response

Alezanello commented 1 month ago

Hello!

Thank you for bringing this to our attention. I’d like to clarify—are you only experiencing this issue in Test Mode? Have you tried running the app in Run Mode or publishing it to check if the assets load correctly?

Let us know so we can assist you further!

ercanyuz commented 4 weeks ago

Hi @Alezanello, here is how it looks in Run Mode. Same issue:

image
github-actions[bot] commented 3 weeks ago

This issue is stale because it has been open for 7 days with no activity. If there are no further updates, a team member will close the issue.

ercanyuz commented 2 weeks ago

Hi @Alezanello, could you reproduce the issue?

purr420 commented 1 week ago

I have the same issue. Wish one could chose between image.network and image.asset when using the image widget. Makes little sense to me to rely on web url for images that take up no space. Also impossible to make an offline app without calling images as variables.

Hope they fix this soon!

lbarreteau commented 2 days ago

I have the same issue. After a lot of tests, no solution...

purr420 commented 1 day ago

@lbarreteau It's a simple fix though but requires you to download code and change 'network' to 'asset' in vs code or whatever you use. And then no going back to FF. but if it's the last thing you do before publishing I guess it's ok.