build method
Describes the part of the user interface represented by this widget.
Implementation
@override
Widget build(BuildContext context) {
if (widget.autofocus && !widget.focusNode.isFocused) {
scheduleMicrotask(() {
if (mounted) {
widget.focusNode.requestFocus();
}
});
}
return _FocusScopeWidget(focusNode: widget.focusNode, child: widget.child);
}