renaming play to playing on AnimationWidget

This commit is contained in:
Erick Zanardo
2020-05-30 15:18:16 -03:00
parent 9e4e27e100
commit 11375751d0
3 changed files with 6 additions and 6 deletions

View File

@ -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)),
),

View File

@ -71,7 +71,7 @@ How to use it:
```dart
AnimationWidget(
animation: _animation,
play: true,
playing: true,
center: true,
),
```

View File

@ -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();
}
}