animations property

Map<T, SpriteAnimation>? get animations

Returns the map of animation state and their corresponding animations.

If you want to change the contents of the map use the animations setter and pass in a new map of animations.

Implementation

Map<T, SpriteAnimation>? get animations =>
    _animations != null ? Map.unmodifiable(_animations!) : null;
set animations (Map<T, SpriteAnimation>? value)

Sets the given value as new animation state map.

Implementation

set animations(Map<T, SpriteAnimation>? value) {
  if (_animations != value) {
    _animations = value;

    _animationTickers = _animations != null
        ? Map.fromEntries(
            _animations!.entries
                .map((e) => MapEntry(e.key, e.value.createTicker()))
                .toList(),
          )
        : null;
    _resizeToSprite();
  }
}