Created
March 1, 2024 11:43
-
-
Save tusharhow/827d7cc009e6c79709eb1898830627c5 to your computer and use it in GitHub Desktop.
Did you know that in Flutter, bringing gradient colors to your text is a breeze? ππ» Just sprinkle a bit of code magic:
This file contains 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
Text( | |
"Gradient Text Example", | |
style: TextStyle( | |
fontSize: 50.0, | |
fontWeight: FontWeight.bold, | |
foreground: Paint() | |
..shader = const LinearGradient( | |
colors: <Color>[ | |
Colors.red, | |
Colors.blue, | |
], | |
).createShader( | |
const Rect.fromLTWH(0.0, 0.0, 200.0, 70.0), | |
), | |
), | |
textAlign: TextAlign.center, | |
), |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment