opacity method

Widget opacity({
  1. required double opacity,
  2. int durationInSecond = 1,
  3. Duration? duration,
})

add opacity to parent widget

Implementation

Widget opacity({
  required double opacity,
  int durationInSecond = 1,
  Duration? duration,
}) {
  return AnimatedOpacity(
    opacity: opacity,
    duration: duration ?? Duration(milliseconds: 500),
    child: this,
  );
}