Flutter Tutorials

Flutter app development tutorials


flutter – Text gradient background

main.dart


import 'package:flutter/material.dart';

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

More flutter tutorials



About Me

Flutter Developer

Design a site like this with WordPress.com
Get started