简体   繁体   English

flutter 中的 TextFormField

[英]TextFormField in flutter

I have a problem.我有个问题。 I create a TextFormField.我创建了一个 TextFormField。 When text length is so lengthy, I want textField will display as the below image.当文本长度如此之长时,我希望 textField 将显示为下图。 Help me.帮我。 Thank you.谢谢你。

在此处输入图像描述

This is code:这是代码:

TextFormField(
            controller: nameController,
            enabled: false,
            textInputAction: TextInputAction.next,
            keyboardType: TextInputType.emailAddress,
            style: TextUtil.regularArial.copyWith(
              fontSize: ScreenUtil.getInstance().setSp(14),
              color: ColorUtil.grey8E8E8E,
            ),
            decoration: InputDecoration(
              fillColor: Colors.white,
              filled: true,
              isDense: true,
              enabledBorder: OutlineInputBorder(
                borderRadius: BorderRadius.all(Radius.circular(6)),
                borderSide: BorderSide(color: Colors.white, width: 1),
              ),
              hintText: "Email",
              hintStyle: TextUtil.regularArial.copyWith(
                fontSize: ScreenUtil.getInstance().setSp(14),
                color: ColorUtil.grey7A7A7A,
              ),
            ),
            validator: (value){
             
            },
          ),

Try add maxLines: null尝试添加 maxLines:null

TextFormField(maxLines: null)

If the maxLines property is null, there is no limit to the number of lines, and the wrap is enabled.如果 maxLines 属性为 null,则对行数没有限制,并且启用了换行。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM