How to make Flutter TextField
accept multiline? The following code does NOT work:
body: Padding(
child: Column(
children: [
Text('BIO'),
Expanded(
child: TextField(
autofocus: false,
controller: _text,
// https://stackoverflow.com/a/46767771
keyboardType: TextInputType.multiline,
maxLength: null,
),
),
],
crossAxisAlignment: CrossAxisAlignment.start,
),
padding: const EdgeInsets.all(8),
),
(Later, I will remove the blue underline, it's just there to show that it's a 1-liner).
I'm on channel master, v1.2.3-pre.66.
TextField(
keyboardType: TextInputType.multiline,
maxLength: null,
maxLines: null,
)
All you need is to set maxLines
to null
Give the property
maxLines: null
to the TextField
widget
TextField(
autofocus: false,
controller: _text,
keyboardType: TextInputType.multiline,
maxLength: null,
maxLines: null,
),
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With