summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/ui.dart42
1 files changed, 20 insertions, 22 deletions
diff --git a/lib/ui.dart b/lib/ui.dart
index e7c0234..20df8f5 100644
--- a/lib/ui.dart
+++ b/lib/ui.dart
@@ -41,9 +41,7 @@ class ConnectionPage extends StatelessWidget {
),
),
),
- bottomNavigationBar: const SafeArea(
- child: ConnectionStatus(),
- ),
+ bottomNavigationBar: const ConnectionStatus(),
);
}
}
@@ -60,9 +58,7 @@ class DevicesPage extends StatelessWidget {
Expanded(child: ContactList()),
],
),
- bottomNavigationBar: const SafeArea(
- child: ConnectionStatus(),
- ),
+ bottomNavigationBar: const ConnectionStatus(),
);
}
}
@@ -99,24 +95,26 @@ class ConnectionStatus extends StatelessWidget {
@override
Widget build(BuildContext context) {
- return Consumer<AppState>(
- builder: (BuildContext context, AppState state, Widget? child) {
- Icon icon;
- Text text;
+ return SafeArea(
+ child: Consumer<AppState>(
+ builder: (BuildContext context, AppState state, Widget? child) {
+ Icon icon;
+ Text text;
- if (state.brokerConnected && state.serverConnected) {
- icon = const Icon(Icons.cloud, color: Colors.green);
- text = const Text('Connected');
- } else if (state.brokerConnected && !state.serverConnected) {
- icon = const Icon(Icons.cloud_off, color: Colors.orange);
- text = const Text('Connection issue');
- } else {
- icon = const Icon(Icons.cloud_off, color: Colors.red);
- text = const Text('Disconnected');
- }
+ if (state.brokerConnected && state.serverConnected) {
+ icon = const Icon(Icons.cloud, color: Colors.green);
+ text = const Text('Connected');
+ } else if (state.brokerConnected && !state.serverConnected) {
+ icon = const Icon(Icons.cloud_off, color: Colors.orange);
+ text = const Text('Connection issue');
+ } else {
+ icon = const Icon(Icons.cloud_off, color: Colors.red);
+ text = const Text('Disconnected');
+ }
- return ListTile(leading: icon, title: text);
- },
+ return ListTile(leading: icon, title: text);
+ },
+ ),
);
}
}