rebuild method
Rebuilds the child widget configuration and updates the child element.
Implementation
@override
/// Rebuilds the child widget configuration and updates the child element.
void rebuild() {
final builtWidget = runZoned(() {
return (widget as StatelessWidget).build(this);
}, zoneValues: {#buildContext: this});
if (childElement != null &&
Widget.canUpdate(childElement!.widget, builtWidget)) {
if (!identical(childElement!.widget, builtWidget)) {
childElement!.update(builtWidget);
}
} else {
childElement?.unmount();
childElement = builtWidget.createElement();
childElement!.mount(this);
}
}