onDrawFrame property

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

A callback that is invoked for each frame after onBeginFrame has completed and after the microtask queue has been drained.

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.

This can be used to implement a second phase of frame rendering that happens after any deferred work queued by the onBeginFrame phase.

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.onDrawFrame instead. '
  'Deprecated to prepare for the upcoming multi-window support. '
  'This feature was deprecated after v3.9.0-0.1.pre.'
)
@override
VoidCallback? get onDrawFrame => platformDispatcher.onDrawFrame;
  1. @Deprecated('Use WidgetTester.platformDispatcher.onDrawFrame instead. ' 'Deprecated to prepare for the upcoming multi-window support. ' 'This feature was deprecated after v3.9.0-0.1.pre.')
  2. @override
void onDrawFrame=(VoidCallback? callback)
override

Implementation

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