update method
Updates the element with a new Widget and triggers a state update.
Implementation
@override
/// Updates the element with a new [Widget] and triggers a state update.
void update(Widget newWidget) {
super.update(newWidget);
state._widget = newWidget as StatefulWidget;
state.didChangeDependencies();
rebuild();
}