TextField居中问题

Posted by アライさん on 2020年12月16日
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8),
color: Colors.black),
alignment: Alignment.center,
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Image(
image: AssetImage('assets/images/img.png'),
width: 33.w,
height: 33.w,
),
Flexible(
child: TextField(
controller: _accountController,
textInputAction: TextInputAction.next,
onSubmitted: (_) => FocusScope.of(context).nextFocus(),
maxLength: 20,
style: TextStyle(
color: Colors.black87,
fontSize: 36.sp,
),
keyboardType: TextInputType.number,
maxLines: 1,
decoration: InputDecoration(
isDense: true,
contentPadding: EdgeInsets.only(
left: 15.w,
),
counterText: '',
hintText: '请输入用户名',
hintStyle: TextStyle(
color: CommonColors.textGrey,
fontSize: 36.sp,
),
border: InputBorder.none,
),
),
),
],
),
),