spawnSprite method Null safety

SceneObject spawnSprite(
  1. TextureRegion textureRegion,
  2. int priority,
  3. {bool cameraRelative = true,
  4. double rotation = 0.0,
  5. double scale = 1.0,
  6. double opacity = 1.0}
)

Implementation

SceneObject spawnSprite(
  TextureRegion textureRegion,
  int priority, {
  bool cameraRelative = true,
  double rotation = 0.0,
  double scale = 1.0,
  double opacity = 1.0,
}) {
  return buildSprite(textureRegion, priority,
      cameraRelative: cameraRelative, rotation: rotation, scale: scale, opacity: opacity)
    ..spawn();
}