addFrame method

Image addFrame([
  1. Image? image
])

Add a frame to the animation of this Image.

Implementation

Image addFrame([Image? image]) {
  image ??= Image.from(this, noAnimation: true, noPixels: true);
  image.frameIndex = frames.length;
  if (frames.last != image) {
    frames.add(image);
  }
  return image;
}