Created
January 8, 2020 09:42
-
-
Save igabice/160e45caba51b3866d4a4a8559f67b7c to your computer and use it in GitHub Desktop.
Flutter textfield example with multiline
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
final _controller = TextEditingController(); | |
Widget _buildMultilineTextField() { | |
return TextField( | |
controller: this._controller, | |
maxLines: 10, | |
textCapitalization: TextCapitalization.sentences, | |
decoration: InputDecoration( | |
counterText: '${this._controller.text.split(' ').length} words', | |
labelText: 'Enter multiline text:', | |
hintText: 'type something...', | |
border: OutlineInputBorder(), | |
), | |
onChanged: (text) => setState(() {}), | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment