TextSpoilerConfig constructor

TextSpoilerConfig({
  1. TextStyle? textStyle,
  2. TextSelection? textSelection,
  3. TextAlign? textAlign,
  4. int? maxLines,
  5. bool? isEllipsis,
  6. double particleDensity = 20.0,
  7. double particleSpeed = 0.2,
  8. Color particleColor = Colors.white70,
  9. double maxParticleSize = 1.0,
  10. bool enableFadeAnimation = false,
  11. double fadeRadius = 10.0,
  12. double fadeEdgeThickness = 20.0,
  13. bool isEnabled = true,
  14. bool enableGestureReveal = false,
  15. SpoilerMask? maskConfig,
  16. ValueChanged<bool>? onSpoilerVisibilityChanged,
  17. ParticleConfig? particleConfig,
  18. FadeConfig? fadeConfig,
  19. ShaderConfig? shaderConfig,
})

Creates a text spoiler configuration with the specified parameters.

Inherits base properties from SpoilerConfig while adding text-specific customizations such as styling, alignment, and selection.

Implementation

TextSpoilerConfig({
  this.textStyle,
  this.textSelection,
  this.textAlign,
  this.maxLines,
  this.isEllipsis,
  double particleDensity = 20.0,
  double particleSpeed = 0.2,
  Color particleColor = Colors.white70,
  double maxParticleSize = 1.0,
  bool enableFadeAnimation = false,
  double fadeRadius = 10.0,
  double fadeEdgeThickness = 20.0,
  bool isEnabled = true,
  bool enableGestureReveal = false,
  SpoilerMask? maskConfig,
  ValueChanged<bool>? onSpoilerVisibilityChanged,
  ParticleConfig? particleConfig,
  FadeConfig? fadeConfig,
  ShaderConfig? shaderConfig,
}) : super(
        isEnabled: isEnabled,
        enableGestureReveal: enableGestureReveal,
        maskConfig: maskConfig,
        onSpoilerVisibilityChanged: onSpoilerVisibilityChanged,
        shaderConfig: shaderConfig,
        particleConfig: particleConfig ??
            ParticleConfig(
              density: particleDensity,
              speed: particleSpeed,
              color: particleColor,
              maxParticleSize: maxParticleSize,
            ),
        fadeConfig: fadeConfig ??
            (enableFadeAnimation
                ? FadeConfig(
                    padding: fadeRadius,
                    edgeThickness: fadeEdgeThickness,
                  )
                : null),
      );