You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Would it be idle to enable in-memory cache in the init() function.
In my use case, I have a large list that grows as one scrolls to a certain length.
The growing mechanism uses the Provider package but it still causes the flickering when ever I add item to the imageList with Provider. Although as per the docs
The problem with this approach is the memory usage increase. We recommend use only with images in widgets that run setState(), to erase the flicker.
No idea how setState is being called.
To keep it simple, would it be safe to enable in-memory caching for a large list of images?
Any feedback would be appreciated.
The text was updated successfully, but these errors were encountered:
Hi @adeolaex,
the amount of memory used depends on the length of your images. If there are many images or they are very heavy, it may happen that the application closes due to a memory error. It has happened to me and we currently have a similar problem.
Our solution is to place a configurable limit of images that are stored in memory. For example, If your list shows 6 images on the screen, then you can set the limit of images in memory to 6. Then only the last 6 images loaded would be in memory, which would be the ones on the screen, so if the status of the screen is updated, those images would not blink.
We are just starting to implement this solution #2
Yes I have experienced crashes like that in the past due to memory consumption.
Well I will have wait for #2 to be completed. In the mean time I will set the gaplessPlayback of the Image widget to true whilst using platform storage.
Would it be idle to enable in-memory cache in the
init()
function.In my use case, I have a large list that grows as one scrolls to a certain length.
The growing mechanism uses the
Provider
package but it still causes the flickering when ever I add item to the imageList withProvider
. Although as per the docsNo idea how
setState
is being called.To keep it simple, would it be safe to enable in-memory caching for a large list of images?
Any feedback would be appreciated.
The text was updated successfully, but these errors were encountered: