opacity method

Opacity opacity(
  1. double opacity
)

Wraps the widget in an Opacity widget with the given opacity.

The opacity argument must be between 0.0 and 1.0, inclusive, and must not be null. This method allows for fine-grained control over the widget's opacity.

Example:

Text('Hello').opacity(0.5)

Implementation

Opacity opacity(double opacity) => Opacity(opacity: opacity, child: this);