diff options
| author | xengineering <me@xengineering.eu> | 2026-03-20 17:02:39 +0100 |
|---|---|---|
| committer | xengineering <me@xengineering.eu> | 2026-03-20 20:48:52 +0100 |
| commit | 09330228991b73ede49ed186f74a2c4f306d2e20 (patch) | |
| tree | 9dbc60d01cc568ec388068ea69675efc890f22c4 /lib/ui.dart | |
| parent | f021bffe2b37af563037195e0e93a74849cd860b (diff) | |
| download | sia-app-09330228991b73ede49ed186f74a2c4f306d2e20.tar sia-app-09330228991b73ede49ed186f74a2c4f306d2e20.tar.zst sia-app-09330228991b73ede49ed186f74a2c4f306d2e20.zip | |
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.
Diffstat (limited to 'lib/ui.dart')
| -rw-r--r-- | lib/ui.dart | 11 |
1 files changed, 10 insertions, 1 deletions
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<ConnectionPage> { final AppState provider = context.read<AppState>(); 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); }); } |
