Shadow constructor Null safety

const Shadow(
  1. {Color color = const Color(_kColorDefault),
  2. Offset offset =,
  3. double blurRadius = 0.0}

Construct a shadow.

The default shadow is a black shadow with zero offset and zero blur. Default shadows should be completely covered by the casting element, and not be visible.

Transparency should be adjusted through the color alpha.

Shadow order matters due to compositing multiple translucent objects not being commutative.


const Shadow({
  this.color = const Color(_kColorDefault),
  this.offset =,
  this.blurRadius = 0.0,
}) : assert(color != null, 'Text shadow color was null.'),
     assert(offset != null, 'Text shadow offset was null.'),
     assert(blurRadius >= 0.0, 'Text shadow blur radius should be non-negative.');