preserveState method
Preserve state before module reload
Call this before disposing a module to save its state for restoration.
Implementation
void preserveState(String moduleId, Map<String, dynamic> state) {
if (!kDebugMode) return;
_preservedState[moduleId] = Map.from(state);
AirLogger.debug(
'Preserved state for HMR',
context: {'moduleId': moduleId, 'keys': state.keys.toList()},
);
}