Hot reload
DartNative keeps the dev loop you know from Flutter: dn run, edit, press
r, see it live. The reconciler diffs your widget tree and mutates the
real native views in place — the edit-and-see rhythm doesn’t change just
because the pixels are now UIKit and Android views.
dn run # launch on device or simulator
# edit code …
# r → hot reload R → hot restart
Your navigation stack survives hot restart
Flutter preserves the navigation stack through hot reload, but a hot restart wipes all Dart state and drops you back on the first screen — annoying when the screen you’re iterating on is three pushes deep.
DartNative goes further: route names are stored on the native side, which
survives the Dart restart. Register your routes in main() and a hot restart
replays the stack, landing you back on the screen you were working on:
void main() {
registerRoutes({
'/chat': (_) => const ChatScreen(),
'/settings': (_) => const SettingsScreen(),
});
// …
runApp(const App());
}
Press R mid-flow — plugins re-register, state resets, and the navigator
replays /chat → /settings (instantly, without animations) so you’re still
on the screen you were tuning.
While you iterate
Hot reload plays well with the rest of the debugging toolkit:
- The unified log stream keeps flowing — the native-side log buffer is reset on each reload so messages from the old session never bleed into the new one. See Unified logging.
- Verbose framework logs (
verbose: trueonDartNativeLogger.run) show the reconciler’s view mutations as your edits apply — useful when a layout doesn’t update the way you expected.