Shimmer.fromColors constructor
Shimmer.fromColors({})
A convenient constructor provides an easy and convenient way to create a
Shimmer which gradient is LinearGradient made up of baseColor
and
highlightColor
.
Implementation
Shimmer.fromColors({
Key? key,
required this.child,
required Color baseColor,
required Color highlightColor,
this.period = const Duration(milliseconds: 1500),
this.direction = ShimmerDirection.ltr,
this.loop = 0,
this.enabled = true,
}) : gradient = LinearGradient(
begin: Alignment.topLeft,
end: Alignment.centerRight,
colors: <Color>[
baseColor,
baseColor,
highlightColor,
baseColor,
baseColor
],
stops: const <double>[
0.0,
0.35,
0.5,
0.65,
1.0
]),
super(key: key);