-
-
Save sansal54/7ce3bbcfec440251a67453e27734d3ed 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