Sprite constructor Null safety

Sprite(
  1. {required Texture texture,
  2. ScalingMode scalingMode = ScalingMode.containX,
  3. Vector2? position,
  4. double? rotation,
  5. double? scale,
  6. Vector2? size,
  7. Color? color}
)

Implementation

Sprite({
  required this.texture,
  ScalingMode scalingMode = ScalingMode.containX,
  Vector2? position,
  double? rotation,
  double? scale,
  Vector2? size,
  Color? color,
})  : _paint = Paint()..color = color ?? Colors.white,
      _color = color ?? Colors.white,
      _scalingMode = scalingMode,
      _position = position ?? Vector2.all(0.0),
      _rotation = rotation ?? 0.0,
      _scale = scale ?? 1.0,
      _size = size,
      _dirty = true;