SingleGlitter constructor

const SingleGlitter({
  1. Key? key,
  2. double? maxWidth,
  3. double? maxHeight,
  4. double aspectRatio = 1.0,
  5. Color color = kDefaultColor,
  6. double opacity = 1.0,
})

Creates a widget that draws a single static glitter-like shape.

A single glitter with the color is displayed at the aspectRatio to fit the maxWidth and maxHeight. Unlike Glitters, this has the fixed opacity and does not animate.

This widget looks better in a dark background color.

Implementation

const SingleGlitter({
  Key? key,
  this.maxWidth,
  this.maxHeight,
  this.aspectRatio = 1.0,
  this.color = kDefaultColor,
  this.opacity = 1.0,
})  : assert(maxWidth == null || maxWidth > 0.0),
      assert(maxHeight == null || maxHeight > 0.0),
      assert(aspectRatio > 0.0),
      assert(opacity > 0.0 && opacity <= 1.0),
      super(key: key);