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) {
  if (offset != Offset.zero) {
    engineLayer = builder.pushTransform(
      Matrix4.translationValues(offset.dx, offset.dy, 0.0).storage,
      oldLayer: _engineLayer as ui.TransformEngineLayer?,
    );
  } else {
    engineLayer = null;
  }
  addChildrenToScene(builder);
  if (offset != Offset.zero) {
    builder.pop();
  }
}