optimize id input

Signed-off-by: 21pages <pages21@163.com>
This commit is contained in:
21pages 2022-08-23 19:55:58 +08:00
parent 16c1813df1
commit 7c9f799f05

View File

@ -186,9 +186,14 @@ class _ConnectionPageState extends State<ConnectionPage> {
RxBool ftPressed = false.obs; RxBool ftPressed = false.obs;
RxBool connHover = false.obs; RxBool connHover = false.obs;
RxBool connPressed = false.obs; RxBool connPressed = false.obs;
RxBool inputFocused = false.obs;
FocusNode focusNode = FocusNode();
focusNode.addListener(() {
inputFocused.value = focusNode.hasFocus;
});
var w = Container( var w = Container(
width: 320 + 20 * 2, width: 320 + 20 * 2,
padding: EdgeInsets.only(left: 20, right: 20, bottom: 22, top: 30), padding: EdgeInsets.only(left: 20, right: 20, bottom: 22, top: 24),
decoration: BoxDecoration( decoration: BoxDecoration(
color: MyTheme.color(context).bg, color: MyTheme.color(context).bg,
borderRadius: const BorderRadius.all(Radius.circular(13)), borderRadius: const BorderRadius.all(Radius.circular(13)),
@ -197,9 +202,16 @@ class _ConnectionPageState extends State<ConnectionPage> {
child: Column( child: Column(
children: [ children: [
Row( Row(
children: <Widget>[ children: [
Text(
translate('Control Remote Desktop'),
style: TextStyle(fontSize: 19, height: 1),
),
],
).marginOnly(bottom: 15),
Row(
children: [
Expanded( Expanded(
child: Container(
child: TextField( child: TextField(
autocorrect: false, autocorrect: false,
enableSuggestions: false, enableSuggestions: false,
@ -207,28 +219,30 @@ class _ConnectionPageState extends State<ConnectionPage> {
style: TextStyle( style: TextStyle(
fontFamily: 'WorkSans', fontFamily: 'WorkSans',
fontSize: 22, fontSize: 22,
height: 1,
), ),
decoration: InputDecoration( decoration: InputDecoration(
labelText: translate('Control Remote Desktop'), hintText: translate('Enter Remote ID'),
border: hintStyle: TextStyle(
OutlineInputBorder(borderRadius: BorderRadius.zero), color: MyTheme.color(context).placeholder),
helperStyle: TextStyle( border: OutlineInputBorder(
fontWeight: FontWeight.bold, borderRadius: BorderRadius.zero,
fontSize: 16, borderSide: BorderSide(
), color: MyTheme.color(context).placeholder!)),
labelStyle: TextStyle( focusedBorder: OutlineInputBorder(
fontWeight: FontWeight.w500, borderRadius: BorderRadius.zero,
fontSize: 26, borderSide:
letterSpacing: 0.2, BorderSide(color: MyTheme.button, width: 3),
),
), ),
isDense: true,
contentPadding:
EdgeInsets.symmetric(horizontal: 10, vertical: 12)),
controller: _idController, controller: _idController,
onSubmitted: (s) { onSubmitted: (s) {
onConnect(); onConnect();
}, },
), ),
), ),
),
], ],
), ),
Padding( Padding(