Created
November 30, 2018 10:32
-
-
Save shyjuzz/3696709bdc0fe2018f8994d58c03542b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class GradientText extends StatelessWidget { | |
final Shader linearGradient = LinearGradient( | |
colors: <Color>[Color(0xffDA44bb), Color(0xff8921aa)], | |
).createShader(Rect.fromLTWH(0.0, 0.0, 200.0, 70.0)); | |
@override | |
Widget build(BuildContext context) { | |
return Center(child: Text( | |
'Hello World', | |
style: new TextStyle( | |
fontSize: 50.0, | |
fontWeight: FontWeight.bold, | |
foreground: Paint()..shader = linearGradient), | |
),); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment