onRestart method
Fires after every successful hot restart (state lost — main() re-runs). Use this to re-warm caches, re-open connections, etc.
Implementation
void onRestart(void Function(ReloadSucceeded event) handler) {
on<ReloadSucceeded>((e) {
if (e.kind == ReloadKind.hotRestart) handler(e);
});
}