Render an image only when it'll visible
188
You'll need to use Listview.builder
with itemBuilder
instead of a child
It will allow you to only render what is on the screen or what is likely to be on scrolled in the very near future - your performance will be considerably improved
- I recommend watching this video from the Flutter Team on this topic (lazy load a big list view) at flutter.io - if you'd like to go deeper into the topic
Author by
Marcos Gianetti
Updated on December 31, 2022Comments
-
Marcos Gianetti over 1 year
Can i render an imagens only it'll visuble in scrollview?
My app has an list view with many products, when I scrolling down many times the performance of my app is down (i'm using a lazy list), i guess it's becase there many imagens (from web) render up my screen.
I'm thinking to do something like it:
-
Yeasin Sheikh almost 3 yearsi think
builder
already does that for us. likeListview.builder
-
Marcos Gianetti almost 3 years@YeasinSheikh I already think it, but i'm not understanding why the performance down when I scroll for many time.
-
Aristidios almost 3 yearsAre you using
itemBuilder
with it instead of a child ? Let us know if your still having issues - I up voted your question
-
-
Top-Master almost 3 yearsYou could edit your other answer! If this is a suggestion, a comment is more than enough.
-
Aristidios almost 3 yearsYou can see my deleted answer ?
-
Aristidios almost 3 yearsThis is my new answer it's better
-
Aristidios almost 3 yearsshould I include the YouTube link to the video? I didn't now if I could ?
-
Marcos Gianetti almost 3 yearsI saw the video you was posted, it really will help me! @Aristidios
-
Top-Master almost 3 yearsNo, now it's gone; Could you edit and bring down image size? or just delete image, it would be no problem, because the OP has already image showing the same.
-
Aristidios almost 3 years@MarcosGianetti Your welcome amigo ; ) I'll put the link back - I didn't know if I could ^^ - you should Up Vote - Yeasin Sheikh - too his answer was right : )
-
Marcos Gianetti almost 3 yearsI'll publish here and close the thread, now I know what I'll need do at my code, thanks youtube.com/watch?v=qax_nOpgz7E&t=782s
-
Aristidios almost 3 yearsI added it back : ) your welcome ! See you !