-
Notifications
You must be signed in to change notification settings - Fork 28.5k
Asset Image not loading while using Cupertino Picker in bottom sheet #61228
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@sherrychhabra51 |
@VladyslavBondarenko I have tested this in Google Pixel 2 and MI A-1 device and able to reproduce this in both of these devices .
I am facing this issue with CupertinoPicker only, if i use List view instead of Cupertino Picker , it seems to be working fine without any issue. |
@sherrychhabra51 I also noticed that it doesn't happen when I use |
Yes. That's correct. The issue only occurs when we use Image.asset and the same code works fine if used with Icon class or Image.network class. |
I am facing the same issue. |
Hey guys I am facing it as well. Any chance to give us a timeframe, when the issue will be fixed on stable channel? And any available workaround in the meantime? Thanks! |
I am also facing same issue. |
I am facing the same issue for a while now. I thought version 1.20.1 would have address this issue. |
ok.. i know this isnt a fix or even an eloquent workaround but.. it works and allows me to move on and hopefully will help someone else meanwhile, until the issue is resolved. so just as @VladyslavBondarenko said: thats how it worked for me as well. it reminded me of image preloading issues so i took that approach and i tried preloading all the images on the first screen of my app, and it worked. like so: Row( after that.. everything worked nicely. images appeared with text exactly how you would expect and no error messages. |
Hi @yaaqovadam , I really hope that Flutter team will fix this issue ASAP because I have no idea how to find a proper workaround... |
hrmmm.. wellll.........:) i dunno.. i actually preload mine on the sign in screen, the top most widget in the widget tree, before i navigate to the screen with the picker. try doing that. "I really hope that Flutter team will fix this issue ASAP" me too :) |
I am experiencing this same issue. Used @yaaqovadam's workaround, which worked. It would be nice to have this work out of the box, though. Edit: a cleaner way to preload the image file is using
|
Try (for each image):
|
@darshankawar So any updates on this ? |
I was trying to fix the issue for my app for hours! I tried a lot of stuff, and I decided to try one last stupid thing before giving up, but it ended up working in my case!! I'm using FancyShimmerImage inside ListWheelScrollView, which is basically the CachedNetworkImage with a shimmer. I noticed the problem was only happening to me for the visible widgets in the ListWheelScrollView, but when scrolling to the parts where it starts hidden, those images were loading well. So I realized it happens just in the first rendering. Then I had what I thought was a stupid idea, that I set the errorWidget to be displayed in the CachedNetworkImage as the FancyShimmerImage itself, and it ended up that when it tries to load the image again it works. |
thanh @hyungtaecf this is how it work for me
|
Works perfectly that way! Thanks! |
@sherrychhabra51 I tried running your code sample and it seems to work as expected, I believe the bug is fixed. flutter doctor -v (mac)
Closing for now. Incase you still encounter the issue please feel free to write in the comments and we will reopen it. Thank you. |
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of |
Hi Everyone
I am trying to show country flag and names using Cupertino Picker which is used inside a bottom sheet.When the bottom sheet opens up for the first time, Cupertino Picker is throwing an error saying "The method 'toDouble' was called on null."
**I would like to point out two things here:-
Image.asset('images/image_2.jpg', height: 200),
, the same code will work**Below is the stack trace.
Also check the code that I have used to show the flag and name of country:-
code sample
here is the flutter doctor stacktrace:-
Also check screenshots for actual output (having no flag) and expected output (having flag with country name).
The text was updated successfully, but these errors were encountered: