add: change id on flutter

This commit is contained in:
Kingtous 2022-07-15 17:00:37 +08:00
parent fc06762a94
commit b1382c2d57

View File

@ -356,21 +356,28 @@ class _DesktopHomePageState extends State<DesktopHomePage> with TrayListener {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Text(translate("id_change_tip")), Text(translate("id_change_tip")),
Offstage( SizedBox(height: 8.0,),
offstage: msg.isEmpty, Row(
child: Text(msg, style: TextStyle(color: Colors.grey),)).marginOnly(bottom: 4.0), children: [
TextField( Text("ID:").marginOnly(bottom: 16.0),
onChanged: (s) { SizedBox(width: 24.0,),
newId = s; Expanded(
}, child: TextField(
decoration: InputDecoration( onChanged: (s) {
border: OutlineInputBorder() newId = s;
), },
inputFormatters: [ decoration: InputDecoration(
LengthLimitingTextInputFormatter(16), border: OutlineInputBorder(),
// FilteringTextInputFormatter(RegExp(r"[a-zA-z][a-zA-z0-9\_]*"), allow: true) 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,), SizedBox(height: 4.0,),
Offstage( Offstage(