Liniting and deprecating old animation widget way

This commit is contained in:
Erick Zanardo
2020-05-25 12:29:12 -03:00
parent eb702ae07c
commit 7418e3a3ad
2 changed files with 3 additions and 1 deletions

View File

@ -153,6 +153,8 @@ class Util {
/// This actually creates an [EmbeddedGameWidget] with a [SimpleGame] whose only content is an [AnimationComponent] created from the provided [animation].
/// You can use this implementation as base to easily create your own widgets based on more complex games.
/// This is intended to be used by non-game apps that want to add a sprite sheet animation.
///
/// @Deprecated('Use FlameSpriteAnimation instead')
widgets.Widget animationAsWidget(Position size, Animation animation) {
return EmbeddedGameWidget(
BaseGame()..add(AnimationComponent(size.x, size.y, animation)),

View File

@ -64,7 +64,7 @@ class _FlameAnimationWidget extends State<FlameAnimationWidget>
_lastUpdated = DateTime.now().millisecond;
_controller.repeat(
// -/+ 60 fps
period: Duration(milliseconds: 16));
period: const Duration(milliseconds: 16));
});
}