From 09330228991b73ede49ed186f74a2c4f306d2e20 Mon Sep 17 00:00:00 2001 From: xengineering Date: Fri, 20 Mar 2026 17:02:39 +0100 Subject: Add reading server domain name from SQLite3 DB It is annoying to type the server domain name on every app start. This should be way more ergonomic. As a minimal first step reading from the database is implemented and tested with an externally injected database. --- lib/ui.dart | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'lib/ui.dart') diff --git a/lib/ui.dart b/lib/ui.dart index 9603562..3a98be9 100644 --- a/lib/ui.dart +++ b/lib/ui.dart @@ -41,8 +41,17 @@ class _ConnectionPageState extends State { final AppState provider = context.read(); controller = TextEditingController(text: provider.fqdn); + provider.addListener(() { + if (controller.text != provider.fqdn) { + controller.text = provider.fqdn; + controller.selection = TextSelection.fromPosition( + TextPosition(offset: controller.text.length), + ); + } + }); + controller.addListener(() { - provider.fqdn = controller.text; + provider.setFqdn(controller.text); }); } -- cgit v1.3