Skip to content

Instantly share code, notes, and snippets.

@RyouMon
Last active November 13, 2022 06:20
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 RyouMon/b817fc22810472f94b0b0c6bf2a3e126 to your computer and use it in GitHub Desktop.
Save RyouMon/b817fc22810472f94b0b0c6bf2a3e126 to your computer and use it in GitHub Desktop.
TextStyle
import 'package:flutter/material.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: const MyHomePage(title: 'TextStyle'),
);
}
}
class MyHomePage extends StatelessWidget {
const MyHomePage({super.key, required this.title});
final String title;
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: Text(title)),
body: Center(
child: Text(
'Hello, world!',
style: TextStyle(
color: Colors.blue,
fontSize: 18.0,
height: 1.2,
fontFamily: 'Courier',
background: Paint()..color = Colors.yellow,
decoration: TextDecoration.underline,
decorationStyle: TextDecorationStyle.dashed,
),
)));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment