Chung
Chung

Reputation: 165

TextFormField in flutter

I have a problem. I create a TextFormField. When text length is so lengthy, I want textField will display as the below image. Help me. Thank you.

enter image description here

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

Upvotes: 1

Views: 2349

Answers (1)

Aldy Yuan
Aldy Yuan

Reputation: 2045

Try add 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.

Upvotes: 1

Related Questions