I was wondering if it is possible to create a gradient over text Flutter. There is a gist of text gradient using Dart\'s ui, but it is kinda long and I was hoping to be simpler.
Taken from here, you can use Text's style painter.
Create the shader,
final Shader linearGradient = LinearGradient(
colors: [Color(0xffDA44bb), Color(0xff8921aa)],
).createShader(Rect.fromLTWH(0.0, 0.0, 200.0, 70.0));
then use it in the TextStyle's foreground
Text(
'Hello Gradients!',
style: new TextStyle(
fontSize: 60.0,
fontWeight: FontWeight.bold,
foreground: Paint()..shader = linearGradient),
)
Source code