FlowFieldBackground class

Flow-field / Perlin background: thousands of lightweight particles advect through an animated 2D Perlin vector field for a silky, organic look.

No shaders. Fully Flutter Canvas; GPU does the rasterization. Tune particleCount based on device perf (mobile: 1k–3k, desktop: 5k–10k).

Inheritance

Constructors

FlowFieldBackground.new({Key? key, int particleCount = 2000, double noiseScale = 0.003, double noiseSpeed = 0.15, double particleSpeed = 40.0, double turnResponsiveness = 4.0, double lineWidth = 1.2, double segmentSeconds = 1 / 50.0, bool wrap = true, Color backgroundColor = Colors.black, Color colorA = const Color(0xFF00FFC6), Color colorB = const Color(0xFF8A6BFF), double opacity = 0.65, Widget? child, int? seed})
const

Properties

backgroundColor Color
Background fill color.
final
child Widget?
Optional overlay child.
final
colorA Color
Stroke color gradient (mapped by local field speed/curvature).
final
colorB Color
final
hashCode int
The hash code for this object.
no setterinherited
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
lineWidth double
Stroke width of particle segments.
final
noiseScale double
Spatial frequency of the noise field (world units -> normalized coords).
final
noiseSpeed double
Temporal speed of the noise field animation.
final
opacity double
Global stroke opacity (0–1).
final
particleCount int
Particle count (mobile: 1k–3k, desktop: up to 10k+).
final
particleSpeed double
Base particle speed in pixels/sec (before field modulation).
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
seed int?
Deterministic RNG seed.
final
segmentSeconds double
Segment length in seconds (smaller => smoother, more CPU).
final
turnResponsiveness double
How quickly particles steer toward the field vector (0–8 good).
final
wrap bool
If true, particles wrap seamlessly; otherwise they bounce.
final

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() State<FlowFieldBackground>
Creates the mutable state for this widget at a given location in the tree.
override
debugDescribeChildren() List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children.
inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep.
inherited
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) String
A string representation of this object.
inherited
toStringDeep({String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) String
Returns a string representation of this node and its descendants.
inherited
toStringShallow({String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a one-line detailed description of the object.
inherited
toStringShort() String
A short, textual description of this widget.
inherited

Operators

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