SpoilerConfig class

Configuration for the spoiler effect.

This class defines the behavior and appearance of the spoiler animation, including particle properties, fade effects, and gesture interactions.

Legacy scalar fields (marked as @Deprecated) are preserved for backward compatibility. They are automatically mapped into particleConfig and fadeConfig when those configs are not provided explicitly. New code should prefer particleConfig and fadeConfig directly.

Implementers
Annotations

Constructors

SpoilerConfig({@Deprecated('Use particleConfig.density instead') double? particleDensity, @Deprecated('Use particleConfig.speed instead') double? particleSpeed, @Deprecated('Use particleConfig.color instead') Color? particleColor, @Deprecated('Use particleConfig.maxSize instead') double? maxParticleSize, @Deprecated('Use fadeConfig instead') bool? enableFadeAnimation, @Deprecated('Use fadeConfig.padding instead') double? fadeRadius, @Deprecated('Use fadeConfig.edgeThickness instead') double? fadeEdgeThickness, required bool isEnabled, required bool enableGestureReveal, ParticleConfig? particleConfig, FadeConfig? fadeConfig, SpoilerMask? maskConfig, ValueChanged<bool>? onSpoilerVisibilityChanged, ShaderConfig? shaderConfig})
Constructor for the SpoilerConfig class.
SpoilerConfig.defaultConfig()
Returns a default configuration for the spoiler effect.
factory

Properties

enableFadeAnimation → bool?
Determines whether the particles will fade out over time.
final
enableGestureReveal → bool
Determines whether user gestures can be used to reveal the spoiler.
final
fadeConfig → FadeConfig?
Fade configuration.
final
fadeEdgeThickness → double?
Padding near the fade radius where particles get brighter/larger in shader.
final
fadeRadius → double?
The padding over which the fade effect is applied.
final
hashCode → int
The hash code for this object.
no setteroverride
isEnabled → bool
Controls whether the spoiler effect is active.
final
maskConfig → SpoilerMask?
Optional configuration for applying a custom mask to the spoiler.
final
maxParticleSize → double?
The maximum size a particle can have.
final
onSpoilerVisibilityChanged → ValueChanged<bool>?
Optional callback that is invoked when the visibility of the spoiler changes.
final
particleColor → Color?
The color of the particles.
final
particleConfig → ParticleConfig
Particle configuration.
final
particleDensity → double?
The density of the particles, affecting the number of particles displayed.
final
particleSpeed → double?
The speed at which particles move.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
shaderConfig → ShaderConfig?
Optional configuration for applying a custom shader to the spoiler.
final

Methods

copyWith({double? particleDensity, double? particleSpeed, Color? particleColor, double? maxParticleSize, bool? enableFadeAnimation, double? fadeRadius, double? fadeEdgeThickness, bool? isEnabled, bool? enableGestureReveal, ParticleConfig? particleConfig, FadeConfig? fadeConfig, SpoilerMask? maskConfig, ValueChanged<bool>? onSpoilerVisibilityChanged, ShaderConfig? shaderConfig}) → SpoilerConfig
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
override