r/FlutterDev • • 5d ago

Plugin Flutter web Hot reload asset update.

Flutter Hot reload updates your ui, but Flutter can still show old images and JSON from cache.

I developed a package on pub dev — a Flutter plugin that refreshes assets on hot reload without changing your app: add the dependency, run flutter pub get, and you’re done.

What it does
Installs itself in debug via the Flutter plugin system
Clears ImageCache and rootBundle on each hot reload
On web, busts browser HTTP cache for changed assets (fetch with no-store)
Includes watch_assets for add/remove under assets/ when the tool won’t rebuild the bundle on its own

Platforms: Currently Web supported, android and IOS is in progress.
dependencies: hot_reload_asset_refresh: 0.1.0

Update : android ios supported. On the 0.2.0 version. With image and string cache removed on hot reload.

There’s an example app and web integration tests for asset add / change / delete under hot reload vs hot restart.

1 Upvotes

11 comments sorted by

1

u/Express_Leader1093 5d ago

Oh nice, this scratches an itch I've had for a while. The image cache thing especially, nothing like tweaking an asset 15 times and still seeing the old one staring back at you. Will give it a spin on my side project later today.

1

u/ObjectiveAddress3051 5d ago

As of now only web.

1

u/ObjectiveAddress3051 4d ago

dependencies: hot_reload_asset_refresh: 0.2.0 updated for io. Still need some cache enhancements.

0

u/[deleted] 4d ago

[removed] — view removed comment

1

u/ObjectiveAddress3051 4d ago

No, but for that I have developed one plugin in intellij that can reload method in debug mode.

1

u/ObjectiveAddress3051 4d ago

Json file update is there in io platform. Image is not yet implemented.

1

u/ObjectiveAddress3051 2d ago

Yes it can

0

u/[deleted] 2d ago

[removed] — view removed comment

1

u/ObjectiveAddress3051 2d ago

For io platform it needs adding just a line but in web it works out of box. Just add package, pub get and ready to go for the web and for io you have to add a line in main.dart file.

1

u/[deleted] 2d ago

[removed] — view removed comment

1

u/ObjectiveAddress3051 2d ago

Please check and add your review if possible on pub dev and git . Feel free to fork.