如何在TextFormField中添加额外的标签?

时间:2019-03-28 11:53:11

标签: flutter flutter-layout

是否可以在TextFormField中放置“忘记密码”标签?

sample

在样本图片上放忘记密码?就在输入中

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,
                  ),

1 个答案:

答案 0 :(得分:4)

使用-Suffix:的{​​{1}}属性

InputDecoration:

<code>enter image description here</code>