rebuild method

  1. @override
void rebuild()
override

Rebuilds the element.

Implementation

@override
void rebuild() {
  if (constraints != null) {
    final builderWidget = widget as LayoutBuilder;
    final childWidget = builderWidget.builder(this, constraints!);
    if (_child != null &&
        _child!.widget.runtimeType == childWidget.runtimeType) {
      _child!.update(childWidget);
    } else {
      _child?.unmount();
      _child = childWidget.createElement();
      _child!.mount(this);
    }
    _child!.layout(constraints!);
  }
}