onBeginFrame property

  1. @Deprecated('Use WidgetTester.platformDispatcher.onBeginFrame instead. ' 'Deprecated to prepare for the upcoming multi-window support. ' 'This feature was deprecated after v3.9.0-0.1.pre.')
  2. @override
FrameCallback? get onBeginFrame
override

A callback that is invoked to notify the window that it is an appropriate time to provide a scene using the SceneBuilder API and the render method.

Accessing this value returns the value contained in the PlatformDispatcher singleton, so instead of getting it from here, you should consider getting it from WidgetsBinding.instance.platformDispatcher instead (or, when WidgetsBinding isn't available, from PlatformDispatcher.instance). The reason this value forwards to the PlatformDispatcher is to provide convenience for applications that only use a single main window.

When possible, this is driven by the hardware VSync signal. This is only called if scheduleFrame has been called since the last time this callback was invoked.

The onDrawFrame callback is invoked immediately after onBeginFrame, after draining any microtasks (e.g. completions of any Futures) queued by the onBeginFrame handler.

The framework invokes this callback in the same zone in which the callback was set.

See also:

  • SchedulerBinding, the Flutter framework class which manages the scheduling of frames.
  • RendererBinding, the Flutter framework class which manages layout and painting.

Implementation

@Deprecated(
  'Use WidgetTester.platformDispatcher.onBeginFrame instead. '
  'Deprecated to prepare for the upcoming multi-window support. '
  'This feature was deprecated after v3.9.0-0.1.pre.'
)
@override
FrameCallback? get onBeginFrame => platformDispatcher.onBeginFrame;
  1. @Deprecated('Use WidgetTester.platformDispatcher.onBeginFrame instead. ' 'Deprecated to prepare for the upcoming multi-window support. ' 'This feature was deprecated after v3.9.0-0.1.pre.')
  2. @override
set onBeginFrame (FrameCallback? callback)
override

Implementation

@Deprecated(
  'Use WidgetTester.platformDispatcher.onBeginFrame instead. '
  'Deprecated to prepare for the upcoming multi-window support. '
  'This feature was deprecated after v3.9.0-0.1.pre.'
)
@override
set onBeginFrame(FrameCallback? callback) {
  platformDispatcher.onBeginFrame = callback;
}