1

I would like to make a text field that starts with 5 blank lines and that grows when the users types more than 5 lines.

I already have this code:

new Container(
 margin: EdgeInsets.all(10.0),
 child: TextFormField(
  maxLines: null,
  keyboardType: TextInputType.multiline,
  decoration: InputDecoration(labelText: 'Enter description'),
  controller: descriptionController,
  )
)

But now I want the text field to start with 5 lines.

Thanks in advance!

dshukertjr
  • 15,244
  • 11
  • 57
  • 94
Awmand
  • 11
  • 1
  • You could use something like https://stackoverflow.com/questions/51205333/flutter-textfield-that-auto-expands-when-text-is-entered-and-then-starts-scrolli/51205467#51205467 If you design the input so that it doesn't have a border you could make it look like 5 lines heigh even if it doesn't yet have that much text. – Günter Zöchbauer Sep 28 '18 at 08:05

1 Answers1

0

It doesn't appear to be possible at this time. It's a definitely a good thing to have. A minLines feature request has been submitted to the developers and is being considered. https://github.com/flutter/flutter/issues/20957

F-1
  • 2,887
  • 20
  • 28