markNeedsBuild method

  1. @override
void markNeedsBuild()
override

Marks the element as dirty and adds it to the global list of widgets to rebuild in the next frame.

Since it is inefficient to build an element twice in one frame, applications and widgets should be structured so as to only mark widgets dirty during event handlers before the frame begins, not during the build itself.

Implementation

@override
void markNeedsBuild() {
  if (_suppressMarkNeedsBuild) return;
  super.markNeedsBuild();
}