SliverOpacity constructor Null safety

const SliverOpacity(
  1. {Key? key,
  2. required double opacity,
  3. bool alwaysIncludeSemantics = false,
  4. Widget? sliver}
)

Creates a sliver that makes its sliver child partially transparent.

The opacity argument must not be null and must be between 0.0 and 1.0 (inclusive).

Implementation

const SliverOpacity({
  super.key,
  required this.opacity,
  this.alwaysIncludeSemantics = false,
  Widget? sliver,
}) : assert(opacity != null && opacity >= 0.0 && opacity <= 1.0),
     assert(alwaysIncludeSemantics != null),
     super(child: sliver);