didUpdateWidget method
Switch out the old StatefulWidget object with the new one.
Implementation
@override
void didUpdateWidget(covariant T oldWidget) {
super.didUpdateWidget(oldWidget);
_statefulStates.removeWhere((key, value) => key == oldWidget);
_statefulStates[widget] = this;
}