build method
Describes the part of the user interface represented by this widget.
Implementation
@override
Widget build(BuildContext context) {
_updateListener();
return Focus(
focusNode: _focusNode,
onFocusChange: (hasFocus) {
widget.focused = hasFocus;
widget.onFocusChange?.call(hasFocus);
if (mounted) {
setState(() {}); // Redraw cursor highlight
}
},
onKeyEvent: (event) {
return widget.handleKeyEvent(event);
},
child: _TextFieldRenderWidget(widget),
);
}