addToScene method

  1. @override
void addToScene(
  1. SceneBuilder builder
)
override

Override this method to upload this layer to the engine.

Implementation

@override
void addToScene(ui.SceneBuilder builder) {
  assert(clipRect != null);
  bool enabled = true;
  assert(() {
    enabled = !debugDisableClipLayers;
    return true;
  }());
  if (enabled) {
    engineLayer = builder.pushClipRect(
      clipRect!,
      clipBehavior: clipBehavior,
      oldLayer: _engineLayer as ui.ClipRectEngineLayer?,
    );
  } else {
    engineLayer = null;
  }
  addChildrenToScene(builder);
  if (enabled) {
    builder.pop();
  }
}