didUpdateWidget method
Called whenever the widget configuration changes.
Implementation
@override
void didUpdateWidget(TextField oldWidget) {
super.didUpdateWidget(oldWidget);
_updateListener();
if (widget.focusNode != oldWidget.focusNode) {
if (oldWidget.focusNode == null) {
_focusNode.dispose();
}
_focusNode =
widget.focusNode ?? FocusNode(id: 'textfield_${widget.hashCode}');
}
if (widget.focused != oldWidget.focused) {
if (widget.focused) {
_focusNode.requestFocus();
} else {
_focusNode.unfocus();
}
}
}