Skip to content

Instantly share code, notes, and snippets.

@tusharhow
Created March 1, 2024 11:43
Show Gist options
  • Select an option

  • Save tusharhow/827d7cc009e6c79709eb1898830627c5 to your computer and use it in GitHub Desktop.

Select an option

Save tusharhow/827d7cc009e6c79709eb1898830627c5 to your computer and use it in GitHub Desktop.

Revisions

  1. tusharhow created this gist Mar 1, 2024.
    17 changes: 17 additions & 0 deletions gradient.dart
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,17 @@
    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,
    ),