I have noticed a problem where image asset loading is too slow to be useable.
In this simple example (below) when the image is loaded you can see an initial screen and then the image asset loads and appears on the screen.
I was expecting to see everything drawn in one go rather than seeing the asset being loaded
Widget build(BuildContext context) {
return Scaffold(
body: Stack(
children: [
Positioned.fill(child: Image.asset(imagePaths[6], fit: BoxFit.cover)),
]
)
);
}
When i run this I see a white screen and then see each asset load, the assets are small images, so size is not the issue
Any idea what i can do to make these images load faster?
Even in release build its loading the asset so slow the user can see it load
--
You received this message because you are subscribed to the Google Groups "Flutter Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to flutter-dev...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
for (int index = 0; index < imagePaths.length; index++) {
precacheImage(AssetImage(imagePaths[index]), context)
.then((result) {
print('$result');
});
--