Home > Mobile >  Change `hint text` length of textfield before gets truncated
Change `hint text` length of textfield before gets truncated

Time:12-07

How to change hint text length, of textfield widget?. The hint text is truncated with ... for an example, Write your text here by cli.... But I need it to show the full length.

TextField(
            minLines: null,
            maxLines: null,
            maxLength: 100,
            keyboardType: TextInputType.multiline,
  decoration: InputDecoration(
    border: InputBorder.none,
    hintText: 'Write your text here by clicking here on this loonnggggg text'
  ),
),
);

CodePudding user response:

you can use hintMaxLines. like hintMaxLines: 2

TextField(
      minLines: null,
      maxLines: null,
      maxLength: 100,
      keyboardType: TextInputType.multiline,
      decoration: InputDecoration(
        border: InputBorder.none,
        hintText: 'Write your text here by clicking here on this loonnggggg text',
        hintMaxLines: 2,
      ),
    )

CodePudding user response:

Try below code hope its help to you. Used hintMaxLines property for that

Refer hintMaxLines enter image description here

  • Related