Map<String, Object?> encode() => { if (animations != null) 'animations': [for (final e in animations!) e.encode()], if (image != null) 'image': image!.encode(), };