Skip to content

Commit

Permalink
fix!: Removed unused parameters from SpriteWidget (#3074)
Browse files Browse the repository at this point in the history
The unused fields of "SpriteWidget", "srcPosition" and "srcSize" and
their matching parameter in the default constructor has been removed.


If SpriteWidget is used, remove the parameter srcPosition and srcSize as
they have not been used in the default constructor.
(This does not belong to SpriteWidget.asset())
  • Loading branch information
YukiAttano committed Mar 8, 2024
1 parent 9282cc3 commit f49d24c
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions packages/flame/lib/src/widgets/sprite_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,6 @@ class SpriteWidget extends StatelessWidget {
/// The angle to rotate this [Sprite], in rad. (default = 0)
final double angle;

/// Holds the position of the sprite on the image
final Vector2? srcPosition;

/// Holds the size of the sprite on the image
final Vector2? srcSize;

/// A builder function that is called if the loading fails
final WidgetBuilder? errorBuilder;

Expand All @@ -33,12 +27,13 @@ class SpriteWidget extends StatelessWidget {

final FutureOr<Sprite> _spriteFuture;

/// renders the [sprite] as a Widget.
///
/// To change the source size and position, see [Sprite.new]
const SpriteWidget({
required Sprite sprite,
this.anchor = Anchor.topLeft,
this.angle = 0,
this.srcPosition,
this.srcSize,
this.errorBuilder,
this.loadingBuilder,
super.key,
Expand All @@ -55,8 +50,8 @@ class SpriteWidget extends StatelessWidget {
Images? images,
this.anchor = Anchor.topLeft,
this.angle = 0,
this.srcPosition,
this.srcSize,
Vector2? srcPosition,
Vector2? srcSize,
this.errorBuilder,
this.loadingBuilder,
super.key,
Expand Down

0 comments on commit f49d24c

Please sign in to comment.