Glitters constructor

const Glitters({
  1. Key? key,
  2. double? minSize,
  3. double? maxSize,
  4. Duration? duration,
  5. Duration? inDuration,
  6. Duration? outDuration,
  7. Duration? interval,
  8. Duration delay = Duration.zero,
  9. Color? color,
  10. double? maxOpacity,
})

Creates a widget that fades in and out glitter-like shapes one by one.

Each glitter is sized between minSize and maxSize for every animation and shown with the color. It fades in and reaches maxOpacity over the duration of inDuration, stays for the span of duration, and then fades out over outDuration. The next animation begins after a wait of interval duration. The start of animation can be delayed with delay.

You can set common settings for multiple Glitters widgets using the parameters with the same name in GlitterStack as the ones in this widget.

This widget looks better in a dark background color.

Implementation

const Glitters({
  Key? key,
  this.minSize,
  this.maxSize,
  this.duration,
  this.inDuration,
  this.outDuration,
  this.interval,
  this.delay = Duration.zero,
  this.color,
  this.maxOpacity,
})  : assert(minSize == null ||
          minSize > 0.0 && (maxSize == null || maxSize >= minSize)),
      assert(maxSize == null ||
          maxSize > 0.0 && (minSize == null || minSize <= maxSize)),
      assert(maxOpacity == null || maxOpacity > 0.0 && maxOpacity <= 1.0),
      icon = null,
      child = null,
      super(key: key);