Skip to content

Instantly share code, notes, and snippets.

class _MyHomePageState extends State<MyHomePage> {
String myText = "0123456789";
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Colors.black,
appBar: AppBar(
title: Text(widget.title),
),
class _MyHomePageState extends State<MyHomePage> {
String playerName = "Serena";
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Colors.black,
appBar: AppBar(
title: Text(widget.title),
),
class _MyHomePageState extends State<MyHomePage> {
String playerName = "Serena"; // <- defined variable
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Colors.black,
appBar: AppBar(
title: Text(widget.title),
class _MyHomePageState extends State<MyHomePage> {
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Colors.black,
appBar: AppBar(
title: Text(widget.title),
),
body: Center(
child: Container(
class TextPage extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Container(
child: GestureDetector(
onTap: () {
print('tapped');
},
child: Text(
'Hello',
class TextPage extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Container(
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Text(
'Hello',
style: TextStyle(
fontWeight: FontWeight.bold,
@stephaniefash
stephaniefash / pubspec.yaml
Last active August 10, 2020 17:41
Adding a new font
flutter:
# To add custom fonts to your application, add a fonts section here,
# in this "flutter" section. Each entry in this list should have a
# "family" key with the font family name, and a "fonts" key with a
# list giving the asset and other descriptors for the font. For
# example:
fonts:
- family: Vogue
fonts:
- asset: fonts/Vogue.ttf
@stephaniefash
stephaniefash / text_change_font.dart
Last active August 10, 2020 17:14
change font of text in flutter
class _MyHomePageState extends State<MyHomePage> {
String playerName = "Serena";
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Colors.black,
appBar: AppBar(
title: Text(widget.title),
),
@stephaniefash
stephaniefash / test_style.dart
Created August 10, 2020 10:45
text styles.
const TextStyle({
this.inherit = true,
this.color,
this.backgroundColor,
this.fontSize,
this.fontWeight,
this.fontStyle,
this.letterSpacing,
this.wordSpacing,
this.textBaseline,