有没有办法在TextFormField中定位“忘记密码”标签?
在示例图片上放忘了密码?在输入内部
new TextFormField(
decoration: InputDecoration(labelText: 'Password',
labelStyle: TextStyle(
color: Colors.black87,
fontSize: 17,
fontFamily: 'AvenirLight'
),
focusedBorder: UnderlineInputBorder(
borderSide: BorderSide(color: Colors.purple),
),
enabledBorder: new UnderlineInputBorder(
borderSide: BorderSide(color: Colors.grey,
width: 1.0)
),
),
style: TextStyle(
color: Colors.black87,
fontSize: 17,
fontFamily: 'AvenirLight'
),
controller: _passwordController,
obscureText: true,
),
使用 - Suffix:
的InputDecoration:
属性
TextFormField(
decoration: InputDecoration(
suffix: GestureDetector(
onTap: () {
print('tapped');
},
child: Text(
'Forgot Password?',
style: TextStyle(
color: Colors.blue, fontWeight: FontWeight.bold),
),
),
labelText: 'Password',
labelStyle: TextStyle(
color: Colors.black87,
fontSize: 17,
fontFamily: 'AvenirLight'),
focusedBorder: UnderlineInputBorder(
borderSide: BorderSide(color: Colors.purple),
),
enabledBorder: new UnderlineInputBorder(
borderSide: BorderSide(color: Colors.grey, width: 1.0)),
),
style: TextStyle(
color: Colors.black87, fontSize: 17, fontFamily: 'AvenirLight'),
// controller: _passwordController,
obscureText: true,
),