addToScene method

  1. @override
EngineLayer addToScene (SceneBuilder builder, [ Offset layerOffset = ])

Override this method to upload this layer to the engine.

Return the engine layer for retained rendering. When there's no corresponding engine layer, null is returned.


ui.EngineLayer addToScene(ui.SceneBuilder builder, [ Offset layerOffset = ]) {
  bool enabled = true;
  assert(() {
    enabled = !debugDisableClipLayers;
    return true;
  if (enabled)
    builder.pushClipPath(clipPath.shift(layerOffset), clipBehavior: clipBehavior);
  addChildrenToScene(builder, layerOffset);
  if (enabled)
  return null; // this does not return an engine layer yet.