onLoad method

Future<void> onLoad()

Implementation

Future<void> onLoad() async {
  await _loader.load();

  _spriteToRender = sprite;

  if (spriteBackgroundDirection == null) {
    _paintBackground = Paint()
      ..color = color.withOpacity(opacityBackground)
      ..style = PaintingStyle.fill;
  }

  if (sprite == null) {
    _paintAction = Paint()
      ..color = color.withOpacity(opacityKnob)
      ..style = PaintingStyle.fill;
  }

  if (spritePressed == null) {
    _paintActionPressed = Paint()
      ..color = color.withOpacity(opacityBackground)
      ..style = PaintingStyle.fill;
  }
}