summaryrefslogtreecommitdiff
path: root/lib/ui.dart
diff options
context:
space:
mode:
authorxengineering <me@xengineering.eu>2026-03-08 17:53:53 +0100
committerxengineering <me@xengineering.eu>2026-03-08 17:53:53 +0100
commit6ee59e8c2aaf69951f6f80003c23f9cd44976ce1 (patch)
tree0f9f4aeb0a4a52b836b84f588454ff33742b15e2 /lib/ui.dart
parent4bc034c7ab627c50aba7e2ce4da360c14465c150 (diff)
downloadsia-app-6ee59e8c2aaf69951f6f80003c23f9cd44976ce1.tar
sia-app-6ee59e8c2aaf69951f6f80003c23f9cd44976ce1.tar.zst
sia-app-6ee59e8c2aaf69951f6f80003c23f9cd44976ce1.zip
Implement server selection
This lets the user select the fully qualified domain name (FQDN) of the MQTT broker. The FQDN is not yet preserved after a manual disconnect.
Diffstat (limited to 'lib/ui.dart')
-rw-r--r--lib/ui.dart31
1 files changed, 19 insertions, 12 deletions
diff --git a/lib/ui.dart b/lib/ui.dart
index 7a97f32..a191f5f 100644
--- a/lib/ui.dart
+++ b/lib/ui.dart
@@ -29,19 +29,26 @@ class ConnectionPage extends StatelessWidget {
@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(),
+ return Consumer<AppState>(
+ builder: (_, AppState state, _) {
+ return Scaffold(
+ appBar: AppBar(title: const Text("Connection")),
+ body: Padding(
+ padding: const EdgeInsets.all(16.0),
+ child: TextField(
+ decoration: const InputDecoration(
+ labelText: "Server name",
+ hintText: "iot.example.org",
+ border: OutlineInputBorder(),
+ ),
+ onChanged: (String value) {
+ state.fqdn = value;
+ },
+ ),
),
- ),
- ),
- bottomNavigationBar: const ConnectionStatus(),
+ bottomNavigationBar: const ConnectionStatus(),
+ );
+ }
);
}
}