Flutter image preload

Use the precacheImage function to start loading an image before your drawer is built. For example, in the widget that contains your drawer:

class MyWidgetState extends State<MyWidget> {

  @override
  void initState() {
    // Adjust the provider based on the image type
    precacheImage(new AssetImage('...'));
    super.initState();
  }

}

Leave a Comment