shimmer static method

Widget shimmer({
  1. double height = 48,
  2. double width = 48,
  3. double borderRadius = 0,
  4. Color? baseColor,
  5. Color? highlightColor,
  6. EdgeInsets margin = const EdgeInsets.all(0),
  7. ShimmerDirection direction = ShimmerDirection.ltr,
})

Implementation

static Widget shimmer({
  double height = 48,
  double width = 48,
  double borderRadius = 0,
  Color? baseColor,
  Color? highlightColor,
  EdgeInsets margin = const EdgeInsets.all(0),
  ShimmerDirection direction = ShimmerDirection.ltr,
}) {
  return Padding(
    padding: margin,
    child: Shimmer.fromColors(
      baseColor: baseColor ?? Colors.grey[200]!,
      highlightColor: highlightColor ?? Colors.grey[300]!,
      direction: direction,
      child: Container(
        decoration: BoxDecoration(
            color: Colors.grey,
            borderRadius: BorderRadius.all(
                Radius.circular(borderRadius == null ? 0 : borderRadius))),
        height: height,
        width: width,
      ),
    ),
  );
}