ImageParticle class

A custom ConfettiParticle that renders an image.

The ImageParticle class extends ConfettiParticle to display an image as a particle in a confetti animation. It supports creating particles from both raster image assets and SVG assets, with optional color modifications.

Constructors

ImageParticle({required Image image, Color? color})
Creates an ImageParticle with the given image and optional color.

Properties

color Color?
An optional color overlay applied to the particle.
final
hashCode int
The hash code for this object.
no setterinherited
image Image
The image displayed by this particle.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
paint({required ConfettiPhysics physics, required Canvas canvas}) → void
Paints the particle on the provided canvas using the given physics.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

createUIImageFromImageAsset(String imageAsset, {int height = 50, int width = 50}) Future<Image>
Creates an Image object from a raster image asset.
createUIImageFromSvgAsset(String svgAsset, {int height = 50, int width = 50}) Future<Image>
Creates an Image object from an SVG asset.