FLUTTER ECOSYSTEM

tunitowen/gradient_text

Widget do Flutter para exibir texto com gradiente

Capa do projeto texto em gradiente
Stars
30
Forks
7
Último push (UTC)
12 de out. de 2021
Status do projeto
Ativo
Tony Owen GitHub avatar
GITHUB User

Tony Owen ↗

OwenTech LtdLeeds
LinguagensDartJavaObjective-CSwiftKotlin

Tópicos técnicos

Pacotes publicados por este repositório

Dependências usadas

Lista de dependências 2 itens
  • flutter{"sdk":"flutter"}
  • flutter_testDesenvolvimento{"sdk":"flutter"}

README original

Texto original em inglês. Visite o GitHub para a versão atual.

Expandir / recolher README

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: ^1.0.2

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.