grad_text

A Flutter Widget to draw gradients into text.(Null safe)

Demo

Install

Add the plugin

dependencies:
  ...
  grad_text: ^0.0.3

Usage

import 'package:grad_text/grad_text.dart';

Use it:

GradientText(
    text: 'My Name is Karthik',
    colors: <Color>[
        Colors.deepOrange,
        Colors.yellow
    ],
    style: TextStyle(fontSize: 30.0),
);

Parameters

ParameterRequiredDescription
texttrueText to show.
colorstrueList of colors to apply.
stylefalseText style.
overflowfalseHow visual overflow should be handled.
textAlignfalseHow the text should be aligned horizontally.
tileModefalseDefines what happens at the edge of the gradient.
customGradientfalseUse a custom gradient. This will override the type following parameters: type, colors, transform and tileMode.
gradientDirectionfalseSet gradient direction. Possible values: rtl (Right to left), ltr (Left to right), ttb (Top to bottom), btt (Bottom to top)
transformfalseUsed for transforming gradient shaders without applying the same transform to the entire canvas.
typefalseSet gradient type. Possible values: linear and radial

Libraries

grad_text