Lightning constructor

const Lightning({
  1. Key? key,
  2. required Widget child,
  3. Duration? delayDuration = const Duration(milliseconds: 500),
  4. bool useGesture = false,
  5. double borderRadius = 0,
  6. bool repeatInfinity = false,
  7. LightningController? controller,
  8. Duration pauseRepeatInfinityDelay = const Duration(seconds: 2),
  9. Color overlayColor = const Color.fromRGBO(255, 255, 255, 0.1),
  10. Duration pauseDuration = const Duration(milliseconds: 200),
  11. Duration durationIn = const Duration(milliseconds: 300),
  12. Duration durationOut = const Duration(milliseconds: 600),
  13. Curve curveIn = Curves.easeIn,
  14. Curve curveOut = Curves.linear,
  15. LightningDirection direction = LightningDirection.leftToRight,
  16. bool autoStart = true,
})

Creates a Lightning widget.

The child parameter is required and represents the widget that will have the lightning effect applied to it.

Implementation

const Lightning(
    {super.key,
    required this.child,
    this.delayDuration = const Duration(milliseconds: 500),
    this.useGesture = false,
    this.borderRadius = 0,
    this.repeatInfinity = false,
    this.controller,
    this.pauseRepeatInfinityDelay = const Duration(seconds: 2),
    this.overlayColor = const Color.fromRGBO(255, 255, 255, 0.1),
    this.pauseDuration = const Duration(milliseconds: 200),
    this.durationIn = const Duration(milliseconds: 300),
    this.durationOut = const Duration(milliseconds: 600),
    this.curveIn = Curves.easeIn,
    this.curveOut = Curves.linear,
    this.direction = LightningDirection.leftToRight,
    this.autoStart = true});