PostFrameContext extension

Convenient BuildContext extensions for PostFrame operations.

on

Methods

awaitLayout(GlobalKey<State<StatefulWidget>> key, {int maxWaitFrames = 20, int stabilityFrames = 2, bool waitForEndOfFrame = true}) Future<Size?>

Available on BuildContext, provided by the PostFrameContext extension

Wait for a widget's layout to stabilize using its GlobalKey.
postFrame(FutureOr<void> action(), {List<ScrollController> scrollControllers = const [], int maxWaitFrames = 5, bool waitForEndOfFrame = true, int endOfFramePasses = 2}) Future<void>

Available on BuildContext, provided by the PostFrameContext extension

Schedule action to run after the current frame with default parameters.
postFrameDebounced<T>(FutureOr<T> action(), {Object? debounceKey, List<ScrollController> scrollControllers = const [], int maxWaitFrames = 5, bool waitForEndOfFrame = true, int endOfFramePasses = 2, Duration? timeout, PostFramePredicate? predicate, void onError(Object error, StackTrace stackTrace)?}) PostFrameTask<T>

Available on BuildContext, provided by the PostFrameContext extension

Debounced post-frame run with context-aware mounted check.
postFrameRun<T>(FutureOr<T> action(), {List<ScrollController> scrollControllers = const [], int maxWaitFrames = 5, bool waitForEndOfFrame = true, int endOfFramePasses = 2, Duration? timeout, PostFramePredicate? predicate, void onError(Object error, StackTrace stackTrace)?}) PostFrameTask<T>

Available on BuildContext, provided by the PostFrameContext extension

Advanced post-frame run with context-aware mounted check predicate.