newton_particles library

Classes

AnimatedParticle
The AnimatedParticle class represents a particle with animation properties.
CircleShape
Represents a circular shape for rendering particles.
DeterministicAnimatedParticle
The DeterministicAnimatedParticle class represents a particle with a deterministic animation path.
DeterministicEffectConfiguration
The DeterministicEffectConfiguration class defines the configuration settings for a deterministic particle effect.
DeterministicPathTransformation
A sealed class representing a deterministic transformation applied to a particle's path.
Effect<Particle extends AnimatedParticle, Configuration extends EffectConfiguration<ParticleConfiguration>>
Abstract class representing a particle effect, defining the behavior of particles and managing their lifecycle within the effect.
EffectConfiguration<T extends ParticleConfiguration>
Configuration class for defining particle emission properties in Newton effects.
Gravity
The Gravity class represents a gravitational force in the 2D plane.
ImageAssetShape
Represents a shape based on an asset image for rendering particles.
ImageShape
Represents a shape based on an image for rendering particles.
LinearInterpolationParticleColor
A ParticleColor subclass representing a linear interpolation of colors for particles based on animation progress.
Newton
The Newton widget serves as the primary interface for creating particle animations in your Flutter app.
NewtonState
The NewtonState is managing active effects and let you add/remove effects at runtime.
NoTrail
A subclass of Trail representing a trail with no visible drawing.
Particle
The Particle class represents a single particle in the animation.
ParticleColor
An abstract class representing the configuration of particle colors.
ParticleConfiguration
The ParticleConfiguration class represents the configuration for a particle in the animation.
PathMetricsTransformation
A path transformation that moves the initial position along a path based on metrics.
RelativisticEffectConfiguration
The RelativisticEffectConfiguration class extends EffectConfiguration to add additional properties for simulating relativistic effects in a particle system.
RelativisticParticle
The RelativisticParticle class represents a particle that is influenced by relativistic effects within a particle system.
Shape
A base class representing various shapes for rendering particles.
SingleParticleColor
A ParticleColor subclass representing a single fixed color for particles.
SolidEdges
The SolidEdges class is used to specify which edges of a 2D boundary are solid, meaning that particles or objects will interact with them as impenetrable boundaries.
SquareShape
Represents a square shape for rendering particles.
StraightPathTransformation
A path transformation that moves the initial position along a straight line.
StraightTrail
A subclass of Trail representing a straight line trail.
Trail
A sealed class representing a trail of particles to be drawn on a canvas.

Enums

EffectState
Represents the various states an effect can be in during its lifecycle.
GradientOrientation
Defines the orientation of a gradient in 2D space.
ParticleLayer
The ParticleLayer enum represents different layers in which particles can be rendered within a particle system, allowing for the creation of depth and visual separation.

Extension Types

Density
The Density extension type represents the density of various materials and substances, expressed in kilograms per square meter (kg/m²).
Friction
The Friction extension type represents a friction coefficient, indicating how much resistance a material or surface provides against motion. The values range from very slippery (like ice) to extremely grippy (like duct tape).
Restitution
The Restitution extension type represents a restitution value, often referred to as the "bounciness" of a material, on a scale from 0 (no bounce) to values greater than 1 (hyper-bouncy).
Tag
Extension type Tag represents a simple wrapper around a string value that can be used to tag or identify specific configurations, effects, or particles within the Newton system.
Velocity
The Velocity extension type represents a velocity value in meters per second (m/s) and provides various predefined constants and adjustment levels for common velocities.

Extensions

EffectForConfiguration on EffectConfiguration<ParticleConfiguration>
Extension on EffectConfiguration that provides a method to create an Effect based on the specific type of EffectConfiguration.
OffsetFromGradientOrientation on GradientOrientation
Extension on GradientOrientation to compute start and end offsets for a gradient based on its orientation.
RandomRange on Random
An extension on the Random class to provide utility methods for generating random numbers within a specified range.

Properties

random Random
Random instance used by effects
final

Typedefs

TransformationData = ({BlendMode? blendMode, Color color, Image image, Rect rect, RSTransform transform})
Data record to hold necessary information about how to transform the image