withShadow method

Widget withShadow(
  1. List<BoxShadow> shadows
)

Implementation

Widget withShadow(List<BoxShadow> shadows) {
  return Stack(
    children: [
      for (final shadow in shadows)
        Transform.translate(
          offset: shadow.offset,
          child: ImageFiltered(
            imageFilter: ImageFilter.blur(sigmaY: shadow.blurRadius, sigmaX: shadow.blurRadius, tileMode: TileMode.decal),
            child: ColorFiltered(
              colorFilter: ColorFilter.mode(shadow.color, BlendMode.srcIn),
              child: this,
            ),
          ),
        ),
      this,
    ],
  );
}