withGlossyEffect method

Widget withGlossyEffect({
  1. Color overlayColor = Colors.white,
  2. double glossFactor = 0.2,
})

Adds a glossy effect overlay to the widget.

Implementation

Widget withGlossyEffect({Color overlayColor = Colors.white, double glossFactor = 0.2}) {
  assert(glossFactor >= 0.0 && glossFactor <= 1.0, "Gloss factor must be between 0.0 and 1.0");
  final blendedColor = overlayColor.withOpacity(glossFactor);
  return Stack(
    children: [
      this,
      Container(
        color: blendedColor,
      ),
    ],
  );
}