gradientText static method
Implementation
static Widget gradientText(Widget child) {
return ShaderMask(
blendMode: BlendMode.srcIn,
shaderCallback: (bounds) => LinearGradient(
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
stops: [0.1, 0.3],
colors: [HexColor.fromHex('#D18F45'), HexColor.fromHex('#D1B445')]).createShader(
Rect.fromLTWH(0, 0, bounds.width, bounds.height),
),
child: child,
);
}