summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorxengineering <me@xengineering.eu>2026-03-06 12:49:29 +0100
committerxengineering <me@xengineering.eu>2026-03-06 12:49:29 +0100
commit12d36a7457759fdd9a0b3c600dfc81fef36ea37f (patch)
tree96a20da0381b4bf8fe9741addcba8ed13bc875f9 /lib
parent2ff436b069564690b204763bc135c3df9611ef0f (diff)
downloadsia-app-12d36a7457759fdd9a0b3c600dfc81fef36ea37f.tar
sia-app-12d36a7457759fdd9a0b3c600dfc81fef36ea37f.tar.zst
sia-app-12d36a7457759fdd9a0b3c600dfc81fef36ea37f.zip
Move MaterialApp up to class Sia
This makes sure there is only one class instance of MaterialApp.
Diffstat (limited to 'lib')
-rw-r--r--lib/ui.dart22
1 files changed, 10 insertions, 12 deletions
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<AppState>(
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: <Widget>[
- Expanded(child: ContactList()),
- ],
- ),
- bottomNavigationBar: const SafeArea(
- child: ConnectionStatus(),
- ),
+ return Scaffold(
+ appBar: AppBar(title: const Text("Contacts")),
+ body: const Column(
+ children: <Widget>[
+ Expanded(child: ContactList()),
+ ],
+ ),
+ bottomNavigationBar: const SafeArea(
+ child: ConnectionStatus(),
),
);
}