particles_network library

Main entry point for the particles_network package.

This library provides the ParticleNetwork widget, which is the primary way to use the particle animation in a Flutter application.

Classes

AccelerationTracker
AdaptivePerformanceController
Dynamically adjusts visualization quality metrics (distance, connections) to maintain a stable target frame rate without dropped frames.
AdaptiveQuadTreeManager
CompressedPath
Represents a compressed path in the quadtree for optimization
CompressedQuadTree
A space-partitioning data structure for efficient 2D spatial queries
CompressedQuadTreeNode
A node in the compressed quadtree data structure
ConnectionData
ConnectionDataPool
DefaultParticleFactory
Default implementation of IParticleFactory that creates randomly configured particles.
GravityConfig
Configuration class for gravity effects.
IntListPool
IParticleController
Abstract interface for controlling particle behavior and physics.
IParticleFactory
Abstract factory interface for creating particle instances.
ObjectPool<T>
OptimizedNetworkPainter
The main painter class for rendering an optimized particle network.
Particle
The Particle class represents a single particle in the particle network. It contains properties for position, velocity, color, size, and visibility.
ParticleFilter
ParticleNetwork
A Flutter widget that renders an interactive particle network visualization.
ParticleNetworkState
The stateful logic and animation controller for the ParticleNetwork widget.
ParticleSimulation
Independent simulation controller managing the particles lifecycle and physics updates.
ParticleUpdater
Default particle controller implementing basic Euler integration physics with gravity support.
PerformanceMonitor
PoolManager
QuadTreeParticle
Represents a particle with index and 2D coordinates.
Rectangle
A 2D axis-aligned rectangle with collision detection capabilities.
SpatialGrid
A 2D uniform spatial grid for efficient neighbor queries.
TouchFeatures
Configuration class for touch interaction behavior and physics.
TouchInteractionHandler
Class that handles touch interactions with particles
TrajectoryBuffer
Precalculates and buffers particle trajectory positions and velocities when no external interactions (e.g. touch) are applied.

Enums

GravityType
Enum to define different types of gravity effects.
Quadrant
Enum representing the four quadrants in 2D space.

Functions

computeVelocity(Offset currentVelocity, Offset defaultVelocity, double speedThreshold, [double decayRate = 0.012]) → Offset
Computes the velocity with gradual decay to return to the default velocity.
createMockParticle({Offset? position, Offset? velocity, Color? color, double? size}) → Particle
Utility function to create a mock particle for testing.