OpacityModifier constructor

const OpacityModifier({
  1. Key? key,
  2. Widget? child,
  3. Key? modifierKey,
  4. required double opacity,
  5. bool alwaysIncludeSemantics = false,
})

Creates a widget that makes its child partially transparent.

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

Implementation

const OpacityModifier({
  super.key,
  super.child,
  super.modifierKey,
  required this.opacity,
  this.alwaysIncludeSemantics = false,
}) : assert(opacity >= 0.0 && opacity <= 1.0);