Search code examples
flutterimageflutter-webflutter-image

Flutter web: The Image.memory makes the web page freeze for a period of time when uploading/downloading an image that has a big size


When a user uploads an image that has a big size, the application will freeze at the moment(Is the app calculating?).

How to fix it to smooth. The Image.network has a leadingBuilder property but the Image.memory doesn't have this property.

And another similar problem. When the Image.memory is assigned in the x parameter and another widget is y. When I use setState for swapping the widget x and y in the Card widget. The web always freezes for a while that the widget swap from y to x(From another widget to Image.memory widget that contain the image with big size).

The example: https://user-images.githubusercontent.com/59549741/165982975-51cbbe78-1c3e-4392-95a0-2654395c68b3.mp4


Solution

  • This issue is technical. Follow at https://github.com/flutter/flutter/issues/102828