gradient_text 1.0.0 copy "gradient_text: ^1.0.0" to clipboard
gradient_text: ^1.0.0 copied to clipboard

outdated

A Flutter Widget for displaying gradient text

GradientText #

A Flutter Widget for displaying gradient text, text with a gradient drawn through it.

GradientTextScreenshot

Getting Started #

Add the plugin (pub coming soon):

dependencies:
  ...
  gradient_text:
    git:
      url: git@github.com:tunitowen/gradient_text.git

Usage #

Import it:

import 'package:gradient_text/gradient_text.dart';

Use it:

GradientText("this is my text",
    gradient: LinearGradient(
    colors: [Colors.deepPurple, Colors.deepOrange, Colors.pink]),
    style: TextStyle(fontSize: 42),
    textAlign: TextAlign.center);

Parameters:

data :: (required) :: The String to be used in the Text Widget

gradient :: (required) :: A gradient to be drawn through the text

style :: (optional) :: TextStyle to be used in the Text Widget. Color is ignored, as the text must be white to have the gradient drawn.

textAlign :: (optional) :: TextAlign to be used in the Text Widget. Default is left.

Credit #

The idea to use ShaderMask came from Reddit user boformer. Thanks boformer.

31
likes
0
pub points
78%
popularity

Publisher

unverified uploader

A Flutter Widget for displaying gradient text

Homepage

License

unknown (license)

Dependencies

flutter

More

Packages that depend on gradient_text