addToScene method
- @override
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
ui.EngineLayer addToScene(ui.SceneBuilder builder, [Offset layerOffset = Offset.zero]) {
bool enabled = true;
assert(() {
enabled = !debugDisableOpacityLayers;
return true;
}());
if (enabled)
builder.pushOpacity(alpha, offset: offset + layerOffset);
addChildrenToScene(builder);
if (enabled)
builder.pop();
return null; // this does not return an engine layer yet.
}