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]) {
assert(offset != null);
_lastOffset = offset + layerOffset;
if (_lastOffset != Offset.zero)
builder.pushTransform(Matrix4.translationValues(_lastOffset.dx, _lastOffset.dy, 0.0).storage);
addChildrenToScene(builder);
if (_lastOffset != Offset.zero)
builder.pop();
return null; // this does not have an engine layer.
}