I’m using a TextField
in Flutter and want to control the line wrapping behavior. How can I set the maxLines
property or adjust the textInputAction
and keyboardType
to achieve this?
TextField(
controller: _messageController,
decoration: const InputDecoration(
hintText: 'Type a message',
border: InputBorder.none,
),
)
Using this code while typing, it’s continuing horizontally but I need to automatically make a new line once reached the end of the typing space available.
2
Answers
Try below code…
Try using TextFormField instead of TextField