didUpdateWidget method
Called whenever the widget configuration changes.
Implementation
@override
void didUpdateWidget(DropdownButton<T> oldWidget) {
super.didUpdateWidget(oldWidget);
if (widget.focused != oldWidget.focused) {
if (widget.focused) {
_focusNode.requestFocus();
} else {
_focusNode.unfocus();
}
}
}