decodeAnimation method Null safety

  1. @override
Animation? decodeAnimation(
  1. List<int> bytes

Decode all of the frames from an animation. If the file is not an animation, a single frame animation is returned. If there was a problem decoding the file, null is returned.


Animation? decodeAnimation(List<int> bytes) {
  final image = decodeImage(bytes);
  if (image == null) {
    return null;

  final anim = Animation();
  anim.width = image.width;
  anim.height = image.height;

  return anim;