rebuild method

  1. @override
void rebuild()
override

Rebuilds the element.

Implementation

@override
void rebuild() {
  final split = widget as SplitPane;
  if (childElement1 != null &&
      childElement1!.widget.runtimeType == split.child1.runtimeType) {
    childElement1!.update(split.child1);
  } else {
    childElement1?.unmount();
    childElement1 = split.child1.createElement();
    childElement1!.mount(this);
  }

  if (childElement2 != null &&
      childElement2!.widget.runtimeType == split.child2.runtimeType) {
    childElement2!.update(split.child2);
  } else {
    childElement2?.unmount();
    childElement2 = split.child2.createElement();
    childElement2!.mount(this);
  }
}