I want to support indentation in a multiline TextField
.
What's the best way to do so? Here's my current approach.
To indent on TAB, I use an explicit TextEditingController
and wrap the TextField
in a CallbackShortcuts
widget to detect the TAB key. I know I could use intents and actions here, but it's simpler this way. I can access then controller from the callbacks.
class _Editor extends State<Editor> {
final _controller = TextEditingController();