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
- flutter – How to overline Text
- flutter – How to draw Text outline
- flutter – Text gradient background
- flutter – How to set Text letter spacing
- flutter – Text with emoji
- flutter – Single line Text
- flutter – Text overflow
- flutter – Text capitalize first letter
- flutter – ElevatedButton onPressed
- flutter – How to add padding to ElevatedButton
- flutter – How to change ElevatedButton shape
- flutter – How to create rounded corners ElevatedButton
- flutter – ElevatedButton border radius only
- flutter – How to add padding to OutlinedButton
- flutter – OutlinedButton shape