newton_particles library

Classes

AnimatedParticle
The AnimatedParticle class represents a particle with animation properties.
AnimationProperties
Groups all animation timing-related properties for particle effects.
CircleShape
Represents a circular shape for rendering particles.
ConfettiPreset
A preset configuration for a confetti celebration effect.
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
An abstract class representing a deterministic transformation applied to a particle's path.
DeterministicProperties
Groups all deterministic-related properties for particle effects.
DurationRange
A range for Duration values.
Effect<ParticleT extends AnimatedParticle, ConfigurationT 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.
EffectDebugData
Debug information about a single particle effect.
EmissionProperties
Groups all emission-related properties for particle effects.
ExplosionPreset
A preset configuration for an explosion effect.
FountainPreset
A preset configuration for a fountain effect.
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.
LayerProperties
Groups all layer-related properties for particle effects.
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.
NewtonCollider
A widget that marks its child as a collision boundary for Newton particles.
NewtonCollisionNotification
Notification sent by NewtonCollider to the Newton root.
NewtonDebugData
Debug information about particle effects for monitoring and performance analysis.
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.
NumRange<T extends num>
A range for numeric types (int, double).
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.
PhysicsEffect
The PhysicsEffect class represents a particle effect that applies physics-based simulation to particles within a simulated world.
PhysicsEffectConfiguration
The PhysicsEffectConfiguration class extends EffectConfiguration to add additional properties for simulating physics-based effects in a particle system.
PhysicsParticle
The PhysicsParticle class represents a particle that is influenced by physics-based simulation within a particle system.
PhysicsPathTransformation
The PhysicsPathTransformation class is responsible for transforming the position of a PhysicsParticle within a NewtonWorld.
PhysicsProperties
Groups all physics-related properties for particle effects.
RainPreset
A preset configuration for a rain effect.
Range<T>
A sealed base class for ranges that encapsulates a min/max pair.
Shape
A base class representing various shapes for rendering particles.
SingleParticleColor
A ParticleColor subclass representing a single fixed color for particles.
SnowPreset
A preset configuration for a snow effect.
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.
TweenPathTransformation
A path transformation that moves the position along a line.
VisualProperties
Groups all visual-related properties for particle effects.

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

PostEffectBuilder = EffectConfiguration<ParticleConfiguration> Function(Particle particle, Effect<AnimatedParticle, EffectConfiguration<ParticleConfiguration>> effect)
Definition of function that returns an Effect to trigger once particle travel is over
ShapeBuilder = Shape Function(Offset initialPosition)
Definition of function that returns a Shape
TransformationData = ({BlendMode? blendMode, Color color, Image image, Rect rect, RSTransform transform})
Data record to hold necessary information about how to transform the image
ZIndexBuilder = int Function(Offset initialPosition)
Definition of function that returns a z-index value for particles