setStateAfterFrame method

void setStateAfterFrame(
  1. VoidCallback? closure
)

Implementation

void setStateAfterFrame(VoidCallback? closure) {
  _widgetsBinding?.ensureVisualUpdate();
  _widgetsBinding?.addPostFrameCallback(
        (timeStamp) {
      if (mounted) {
        setState(() {
          closure?.call();
        });
      }
    },
  );
}