addToScene method Null safety
- SceneBuilder builder
override
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.
Implementation
@override
void addToScene(ui.SceneBuilder builder) {
assert(clipPath != null);
assert(clipBehavior != null);
bool enabled = true;
assert(() {
enabled = !debugDisableClipLayers;
return true;
}());
if (enabled) {
engineLayer = builder.pushClipPath(
clipPath!,
clipBehavior: clipBehavior,
oldLayer: _engineLayer as ui.ClipPathEngineLayer?,
);
} else {
engineLayer = null;
}
addChildrenToScene(builder);
if (enabled) {
builder.pop();
}
}