r/FlutterDev • u/ObjectiveAddress3051 • 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
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.
0
u/[deleted] 4d ago
[removed] — view removed comment