pipelineOwner property

  1. @Deprecated('Interact with the pipelineOwner tree rooted at RendererBinding.rootPipelineOwner instead. ' 'Or instead of accessing the SemanticsOwner of any PipelineOwner interact with the SemanticsBinding directly. ' 'This feature was deprecated after v3.10.0-12.0.pre.')
PipelineOwner pipelineOwner
latefinal

Deprecated. Will be removed in a future version of Flutter.

This is typically the owner of the render tree bootstrapped by runApp and rooted in renderView. It maintains dirty state for layout, composite, paint, and accessibility semantics for that tree.

However, by default, the pipelineOwner does not participate in frame production because it is not automatically attached to the rootPipelineOwner or any of its descendants. It is also not automatically associated with the renderView. This is left as a responsibility for a higher level abstraction. The WidgetsBinding, for example, wires this up in WidgetsBinding.wrapWithDefaultView, which is called indirectly from runApp.

Apps, that don't use the WidgetsBinding or don't call runApp (or WidgetsBinding.wrapWithDefaultView) must manually add this pipeline owner to the pipeline owner tree rooted at rootPipelineOwner and assign a RenderView to it if the they want to use this deprecated property.

Instead of accessing this deprecated property, consider interacting with the root of the PipelineOwner tree (exposed in rootPipelineOwner) or instead of accessing the SemanticsOwner of any PipelineOwner consider interacting with the SemanticsBinding (exposed via SemanticsBinding.instance) directly.

Implementation

@Deprecated(
  'Interact with the pipelineOwner tree rooted at RendererBinding.rootPipelineOwner instead. '
  'Or instead of accessing the SemanticsOwner of any PipelineOwner interact with the SemanticsBinding directly. '
  'This feature was deprecated after v3.10.0-12.0.pre.'
)
late final PipelineOwner pipelineOwner = PipelineOwner(
  onSemanticsOwnerCreated: () {
    (pipelineOwner.rootNode as RenderView?)?.scheduleInitialSemantics();
  },
  onSemanticsUpdate: (ui.SemanticsUpdate update) {
    (pipelineOwner.rootNode as RenderView?)?.updateSemantics(update);
  },
  onSemanticsOwnerDisposed: () {
    (pipelineOwner.rootNode as RenderView?)?.clearSemantics();
  }
);