postFrame method

Future<void> postFrame(
  1. FutureOr<void> action(), {
  2. List<ScrollController> scrollControllers = const [],
  3. int maxWaitFrames = 5,
  4. bool waitForEndOfFrame = true,
  5. int endOfFramePasses = 2,
})

Schedule action to run after the current frame with default parameters.

Includes a built-in predicate that checks if the widget is still mounted.

Implementation

Future<void> postFrame(
  FutureOr<void> Function() action, {
  List<ScrollController> scrollControllers = const [],
  int maxWaitFrames = 5,
  bool waitForEndOfFrame = true,
  int endOfFramePasses = 2,
}) {
  return PostFrame.postFrame(
    action,
    scrollControllers: scrollControllers,
    maxWaitFrames: maxWaitFrames,
    waitForEndOfFrame: waitForEndOfFrame,
    endOfFramePasses: endOfFramePasses,
  );
}