Gradient Text — Flutter
Gradient Text
In flutter it is possible to apply gradient(linear gradient) coloring option to the Text Widget. With the help of the widget called “Gradient Text” we can have a multi-coloring feature to the text widget
Syntax
GradientText(“<text>”,gradient:LinearGradient(colors:[…])
Sample Program
Let us now discuss with a sample program that prints “Hello” using this Gradient Text Widget.
Add the following dependencies in the pubspec.yaml file:
gradient_text: ^1.0.2
Also, import the package:
import ‘package:gradient_text/gradient_text.dart’;
Sample Code:
It is possible to specify any number of colors we want inside the LinearGradient().
Get the Source Code here — Gradient Text Source Code
Output:
Other contributions.,