markNeedsBuild method

  1. @override
void markNeedsBuild()
override

Cause this entry to rebuild during the next pipeline flush.

You need to call this function if the output of builder has changed.

Implementation

@override
void markNeedsBuild() {
  if (SchedulerBinding.instance.schedulerPhase ==
      SchedulerPhase.persistentCallbacks) {
    SchedulerBinding.instance.addPostFrameCallback((_) {
      super.markNeedsBuild();
    });
  } else {
    super.markNeedsBuild();
  }
}