SpriteButton.future constructor

SpriteButton.future({
  1. required Future<Sprite> sprite,
  2. required Future<Sprite> pressedSprite,
  3. required VoidCallback onPressed,
  4. required double width,
  5. required double height,
  6. required Widget label,
  7. Vector2? srcPosition,
  8. Vector2? srcSize,
  9. Vector2? pressedSrcPosition,
  10. Vector2? pressedSrcSize,
  11. WidgetBuilder? errorBuilder,
  12. WidgetBuilder? loadingBuilder,
  13. Key? key,
})

Implementation

SpriteButton.future({
  required Future<Sprite> sprite,
  required Future<Sprite> pressedSprite,
  required this.onPressed,
  required this.width,
  required this.height,
  required this.label,
  this.srcPosition,
  this.srcSize,
  this.pressedSrcPosition,
  this.pressedSrcSize,
  this.errorBuilder,
  this.loadingBuilder,
  super.key,
}) : _buttonsFuture = Future.wait([
        sprite,
        pressedSprite,
      ]);