Load your image assets faster in Flutter!

Future<void> precacheImage(
ImageProvider<Object> provider,
BuildContext context,
{Size? size,
ImageErrorListener? onError}
)
void didChangeDependencies() {      precacheImage(AssetImage("assets/logo.png"), context);     precacheImage(AssetImage("assets/home_bg.png"), context);      super.didChangeDependencies();  
}

Conclusion

Don’t forget to connect with me on:

Don’t stop, until you are breathing!💙
- Abhishek Doshi

--

--

--

Google Developer Expert — Dart, Flutter & Firebase 💙💛

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

How to get screwed with Firebase

How does Last-Mile Delivery Software Minimize the Overall Delivery Costs

Why Take A Coding Bootcamp If You’re Self Taught?

DisplayBuddy Mac App 2022 REVIEW — MacSources

Create a Notebook with Django

Day 6 of Game Dev: Simple 2D Player Movement in Unity!

The BoxedDudes NFTs Whitelist giveaway

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Abhishek Doshi

Abhishek Doshi

Google Developer Expert — Dart, Flutter & Firebase 💙💛

More from Medium

Flutter Freezed — The complete Crashcourse

Creating a Flutter Project Template

Top 8 State Managements for Flutter 2022

Flutter Navigation with AutoRoute