update method

void update()

Re-renders the component.

Implementation

void update() {
  try {
    final oldElement = element;
    element = null;
    final newElement = render();

    oldElement?.replaceWith(newElement);
    stack.where((c) => c == this).first.element = element;
  } catch (err, s) {
    print(err);
    print(s);
  }
}