Commit 75b44f7

derdilla <82763757+NobodyForNothing@users.noreply.github.com>
2024-07-03 09:02:32
fix hot reload
Signed-off-by: derdilla <82763757+NobodyForNothing@users.noreply.github.com>
1 parent 0ee3c8f
Changed files (2)
app/lib/app.dart
@@ -182,11 +182,14 @@ class _AppState extends State<App> {
   }
 
   @override
-  Widget build(BuildContext context) => ConsistentFutureBuilder(
-    future: _loadApp(),
-    onWaiting: const LoadingScreen(),
-    onData: (context, widget) => widget,
-  );
+  Widget build(BuildContext context) {
+    if (_loadedChild != null && _configDB != null && _entryDB != null) return _loadedChild!;
+    return ConsistentFutureBuilder(
+      future: _loadApp(),
+      onWaiting: const LoadingScreen(),
+      onData: (context, widget) => widget,
+    );
+  }
 
   /// Central [MaterialApp] widget of the app that sets the uniform style options.
   Widget _buildAppRoot() => Consumer<Settings>(
app/lib/main.dart
@@ -2,4 +2,4 @@ import 'package:blood_pressure_app/app.dart';
 import 'package:flutter/material.dart';
 
 /// Run the [App].
-void main() => runApp(App());
+void main() => runApp(const App());