From 12d36a7457759fdd9a0b3c600dfc81fef36ea37f Mon Sep 17 00:00:00 2001 From: xengineering Date: Fri, 6 Mar 2026 12:49:29 +0100 Subject: Move MaterialApp up to class Sia This makes sure there is only one class instance of MaterialApp. --- lib/ui.dart | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) (limited to 'lib/ui.dart') diff --git a/lib/ui.dart b/lib/ui.dart index 8d5e52f..02093eb 100644 --- a/lib/ui.dart +++ b/lib/ui.dart @@ -10,7 +10,7 @@ class Sia extends StatelessWidget { Widget build(BuildContext context) { return ChangeNotifierProvider( create: (BuildContext context) => AppState(), - child: const DevicesPage(), + child: const MaterialApp(home: DevicesPage()), ); } } @@ -20,17 +20,15 @@ class DevicesPage extends StatelessWidget { @override Widget build(BuildContext context) { - return MaterialApp( - home: Scaffold( - appBar: AppBar(title: const Text("Contacts")), - body: const Column( - children: [ - Expanded(child: ContactList()), - ], - ), - bottomNavigationBar: const SafeArea( - child: ConnectionStatus(), - ), + return Scaffold( + appBar: AppBar(title: const Text("Contacts")), + body: const Column( + children: [ + Expanded(child: ContactList()), + ], + ), + bottomNavigationBar: const SafeArea( + child: ConnectionStatus(), ), ); } -- cgit v1.3