Skip to content

Instantly share code, notes, and snippets.

@vijayinyoutube
Created May 25, 2020 11:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vijayinyoutube/b3c017487ae95f214ccbdd97c507a58b to your computer and use it in GitHub Desktop.
Save vijayinyoutube/b3c017487ae95f214ccbdd97c507a58b to your computer and use it in GitHub Desktop.
Gradient Text
import 'package:flutter/material.dart';
import 'package:gradient_text/gradient_text.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
theme: ThemeData.light(),
home: MyPage(),
);
}
}
class MyPage extends StatefulWidget {
@override
_MyPageState createState() => _MyPageState();
}
class _MyPageState extends State<MyPage> {
@override
Widget build(BuildContext context) {
return Scaffold(
body: Center(
child: GradientText(
"Hello",
gradient: LinearGradient(colors: [
Color(0xFFFF1000),
Color(0xFF2508FF),
]),
style: TextStyle(fontSize: 55, fontWeight: FontWeight.normal),
),
),
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment