mirror of
https://github.com/flame-engine/flame.git
synced 2025-11-01 19:12:31 +08:00
renaming play to playing on AnimationWidget
This commit is contained in:
@ -131,7 +131,7 @@ void main() async {
|
||||
height: ctx.numberProperty('container height', 200),
|
||||
child: AnimationWidget(
|
||||
animation: _animation,
|
||||
play: ctx.boolProperty('playing', true),
|
||||
playing: ctx.boolProperty('playing', true),
|
||||
anchor: parseAnchor(
|
||||
ctx.listProperty('anchor', 'Anchor.center', anchorOptions)),
|
||||
),
|
||||
|
||||
@ -71,7 +71,7 @@ How to use it:
|
||||
```dart
|
||||
AnimationWidget(
|
||||
animation: _animation,
|
||||
play: true,
|
||||
playing: true,
|
||||
center: true,
|
||||
),
|
||||
```
|
||||
|
||||
@ -9,11 +9,11 @@ import 'dart:math';
|
||||
class AnimationWidget extends StatefulWidget {
|
||||
final Animation animation;
|
||||
final Anchor anchor;
|
||||
final bool play;
|
||||
final bool playing;
|
||||
|
||||
AnimationWidget({
|
||||
this.animation,
|
||||
this.play = true,
|
||||
this.playing = true,
|
||||
this.anchor = Anchor.topLeft,
|
||||
}) : assert(animation.loaded(), 'Animation must be loaded');
|
||||
|
||||
@ -29,7 +29,7 @@ class _AnimationWidget extends State<AnimationWidget>
|
||||
@override
|
||||
void didUpdateWidget(oldWidget) {
|
||||
super.didUpdateWidget(oldWidget);
|
||||
if (widget.play) {
|
||||
if (widget.playing) {
|
||||
_initAnimation();
|
||||
} else {
|
||||
_pauseAnimation();
|
||||
@ -54,7 +54,7 @@ class _AnimationWidget extends State<AnimationWidget>
|
||||
|
||||
widget.animation.onCompleteAnimation = _pauseAnimation;
|
||||
|
||||
if (widget.play) {
|
||||
if (widget.playing) {
|
||||
_initAnimation();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user