0

Does anyone else have a issue with displaying File image in a gridview.builder or list? The images display but if I scroll fast logcat gives an out of memory exception and the app crashes.

I have tired clearing the cache, that doesn't help. Memory used by the app when you get out of memory varies, sometimes 100mb other times 500mb.

I have tried an example to rule out anything daft in code I'm doing by using someone else's example https://github.com/follow2vivek/FlutterGallery but still have the same issue when you scroll up and down fast.

I only have 18 pictures. I have tried a few phones too.

  • How do you load the images? Do you decode them on the fly or call them from an api? – Len_X Feb 15 '20 at 13:58
  • @Len_X on the fly. I call image.file and pass in a path to image stored on the phone. – BeginnerDBADan Feb 15 '20 at 14:00
  • might be best to pre load those images before the list is displayed Here is a thread that covers a similar issue where they use an Network image https://github.com/flutter/flutter/issues/32143 – Len_X Feb 15 '20 at 20:24

0 Answers0