rebuild method

  1. @override
void rebuild()
override

Rebuilds the element.

Implementation

@override
void rebuild() {
  final cw = childWidget;
  if (cw != null) {
    if (childElement != null && Widget.canUpdate(childElement!.widget, cw)) {
      childElement!.update(cw);
    } else {
      childElement?.unmount();
      childElement = cw.createElement();
      childElement!.mount(this);
    }
  } else {
    childElement?.unmount();
    childElement = null;
  }
}