Skip to content

Instantly share code, notes, and snippets.

@daninfpj
Last active February 21, 2020 23:09
Show Gist options
  • Save daninfpj/b22b1c4344c0c911d03e3f4baa87cbb9 to your computer and use it in GitHub Desktop.
Save daninfpj/b22b1c4344c0c911d03e3f4baa87cbb9 to your computer and use it in GitHub Desktop.
Flutter Themes
import 'package:flutter/material.dart';
final Color darkBlue = Color.fromARGB(255, 18, 32, 47);
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
theme: ThemeData.dark().copyWith(scaffoldBackgroundColor: darkBlue),
debugShowCheckedModeBanner: false,
home: Scaffold(
body: Center(
child: MyWidget(),
),
),
);
}
}
class MyWidget extends StatelessWidget {
@override
Widget build(BuildContext context) {
var textTheme = Typography.whiteCupertino.merge(Typography.englishLike2018);
var bold = TextStyle(fontWeight: FontWeight.w700);
var italic = TextStyle(fontStyle: FontStyle.italic);
var xxl = TextStyle(fontSize: 96);
return Column(children: [
Text('Display 4', style: textTheme.headline1),
Text('Headline', style: textTheme.headline5),
Text('Body', style: textTheme.bodyText2),
Text('Bold', style: textTheme.bodyText2.merge(bold)),
Text('Italic', style: textTheme.bodyText2.merge(italic)),
Text('Italic bold', style: textTheme.bodyText2.merge(bold).merge(italic)),
Text('XXL', style: textTheme.bodyText2.merge(xxl)),
]);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment