From b1382c2d5709a5855ed535b03a5b32067075f215 Mon Sep 17 00:00:00 2001 From: Kingtous Date: Fri, 15 Jul 2022 17:00:37 +0800 Subject: [PATCH] add: change id on flutter --- .../lib/desktop/pages/desktop_home_page.dart | 35 +++++++++++-------- 1 file changed, 21 insertions(+), 14 deletions(-) diff --git a/flutter/lib/desktop/pages/desktop_home_page.dart b/flutter/lib/desktop/pages/desktop_home_page.dart index 305155f0e..17aa597af 100644 --- a/flutter/lib/desktop/pages/desktop_home_page.dart +++ b/flutter/lib/desktop/pages/desktop_home_page.dart @@ -356,21 +356,28 @@ class _DesktopHomePageState extends State with TrayListener { crossAxisAlignment: CrossAxisAlignment.start, children: [ Text(translate("id_change_tip")), - Offstage( - offstage: msg.isEmpty, - child: Text(msg, style: TextStyle(color: Colors.grey),)).marginOnly(bottom: 4.0), - TextField( - onChanged: (s) { - newId = s; - }, - decoration: InputDecoration( - border: OutlineInputBorder() - ), - inputFormatters: [ - LengthLimitingTextInputFormatter(16), - // FilteringTextInputFormatter(RegExp(r"[a-zA-z][a-zA-z0-9\_]*"), allow: true) + SizedBox(height: 8.0,), + Row( + children: [ + Text("ID:").marginOnly(bottom: 16.0), + SizedBox(width: 24.0,), + Expanded( + child: TextField( + onChanged: (s) { + newId = s; + }, + decoration: InputDecoration( + border: OutlineInputBorder(), + errorText: msg.isEmpty ? null : translate(msg) + ), + inputFormatters: [ + LengthLimitingTextInputFormatter(16), + // FilteringTextInputFormatter(RegExp(r"[a-zA-z][a-zA-z0-9\_]*"), allow: true) + ], + maxLength: 16, + ), + ), ], - maxLength: 16, ), SizedBox(height: 4.0,), Offstage(