shimmer static method
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,
})
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,
),
),
);
}