Flutter Tutorials

Flutter app development tutorials


flutter – Gradient Text

main.dart


import 'package:flutter/material.dart';

void main(){
  runApp(
      MaterialApp(
        home: Scaffold(
          appBar: AppBar(
              title: const Text("Flutter - Gradient Text")
          ),
          body: Center(
              child: Text(
                "Lorem Ipsum is simply dummy text.",
                style: TextStyle(
                    fontSize: 70,
                    foreground: Paint()
                      ..shader = const LinearGradient(
                        colors: [
                          Colors.pink,Colors.blue,Colors.green
                        ],
                      ).createShader(
                          const Rect.fromLTWH(0, 0, 400, 300)
                      )
                ),
                textAlign: TextAlign.center,
              )
          ),
        ),
      )
  );
}

More flutter tutorials



About Me

Flutter Developer

Design a site like this with WordPress.com
Get started