summaryrefslogtreecommitdiff
path: root/lib/ui.dart
diff options
context:
space:
mode:
Diffstat (limited to 'lib/ui.dart')
-rw-r--r--lib/ui.dart35
1 files changed, 34 insertions, 1 deletions
diff --git a/lib/ui.dart b/lib/ui.dart
index 02093eb..e7c0234 100644
--- a/lib/ui.dart
+++ b/lib/ui.dart
@@ -10,7 +10,40 @@ class Sia extends StatelessWidget {
Widget build(BuildContext context) {
return ChangeNotifierProvider<AppState>(
create: (BuildContext context) => AppState(),
- child: const MaterialApp(home: DevicesPage()),
+ child: MaterialApp(
+ home: Consumer<AppState>(
+ builder: (_, AppState provider, _) {
+ if (provider.onConnectionPage) {
+ return const ConnectionPage();
+ }
+ return const DevicesPage();
+ }
+ ),
+ ),
+ );
+ }
+}
+
+class ConnectionPage extends StatelessWidget {
+ const ConnectionPage({super.key});
+
+ @override
+ Widget build(BuildContext context) {
+ return Scaffold(
+ appBar: AppBar(title: const Text("Connection")),
+ body: const Padding(
+ padding: EdgeInsets.all(16.0),
+ child: TextField(
+ decoration: InputDecoration(
+ labelText: "Server name",
+ hintText: "iot.example.org",
+ border: OutlineInputBorder(),
+ ),
+ ),
+ ),
+ bottomNavigationBar: const SafeArea(
+ child: ConnectionStatus(),
+ ),
);
}
}