I want to set the default font colour for the flutter app globally. I tried
ThemeData(
primarySwatch: Colors.blue,
fontFamily: 'Gilroy',
textTheme: TextTheme(
bodyText1: TextStyle(),
bodyText2: TextStyle(),
).apply(
bodyColor: const Color(0xff22215B),
displayColor: const Color(0xff22215B),
),
),
Some text is coloured. but Text in Appbar is not applied automatically.
Apply this
ThemeData(
appBarTheme: AppBarTheme(
textTheme: Theme.of(context).textTheme.apply(
bodyColor: const Color(0xff22215B),
displayColor: const Color(0xff22215B),
),
),
textTheme: Theme.of(context).textTheme.apply(
bodyColor: const Color(0xff22215B),
displayColor: const Color(0xff22215B),
),
)
textTheme alone does not affect AppBar. You should use appBarTheme. Try this:
appBarTheme: AppBarTheme(
textTheme: TextTheme(
//...
).apply(
bodyColor: Color(0xff22215B), displayColor: Color(0xff22215B))),
Select your theme at https://rxlabz.github.io/panache_web/#/.
Download the total theme code as well from that website.
Sample Code default font color in flutter?
final ThemeData myTheme = ThemeData(
primarySwatch: Colors.blue,
brightness: Brightness.light,
primaryColor: Color( 0xff2196f3 ),
textTheme: TextTheme(
display4: TextStyle(
color: Color( 0x8a000000 ),
fontSize: null,
fontWeight: FontWeight.w400,
fontStyle: FontStyle.normal,
),
display3: TextStyle(
color: Color( 0x8a000000 ),
fontSize: null,
fontWeight: FontWeight.w400,
fontStyle: FontStyle.normal,
),
display2: TextStyle(
color: Color( 0x8a000000 ),
fontSize: null,
fontWeight: FontWeight.w400,
fontStyle: FontStyle.normal,
),
display1: TextStyle(
color: Color( 0x8a000000 ),
fontSize: null,
fontWeight: FontWeight.w400,
fontStyle: FontStyle.normal,
),
headline: TextStyle(
color: Color( 0xdd000000 ),
fontSize: null,
fontWeight: FontWeight.w400,
fontStyle: FontStyle.normal,
),
title: TextStyle(
color: Color( 0xdd000000 ),
fontSize: null,
fontWeight: FontWeight.w400,
fontStyle: FontStyle.normal,
),
subhead: TextStyle(
color: Color( 0xdd000000 ),
fontSize: null,
fontWeight: FontWeight.w400,
fontStyle: FontStyle.normal,
),
body2: TextStyle(
color: Color( 0xdd000000 ),
fontSize: null,
fontWeight: FontWeight.w400,
fontStyle: FontStyle.normal,
),
body1: TextStyle(
color: Color( 0xdd000000 ),
fontSize: null,
fontWeight: FontWeight.w400,
fontStyle: FontStyle.normal,
),
caption: TextStyle(
color: Color( 0x8a000000 ),
fontSize: null,
fontWeight: FontWeight.w400,
fontStyle: FontStyle.normal,
),
button: TextStyle(
color: Color( 0xdd000000 ),
fontSize: null,
fontWeight: FontWeight.w400,
fontStyle: FontStyle.normal,
),
subtitle: TextStyle(
color: Color( 0xff000000 ),
fontSize: null,
fontWeight: FontWeight.w400,
fontStyle: FontStyle.normal,
),
overline: TextStyle(
color: Color( 0xff000000 ),
fontSize: null,
fontWeight: FontWeight.w400,
fontStyle: FontStyle.normal,
),
),
primaryTextTheme: TextTheme(
display4: TextStyle(
color: Color( 0xb3ffffff ),
fontSize: null,
fontWeight: FontWeight.w400,
fontStyle: FontStyle.normal,
),
display3: TextStyle(
color: Color( 0xb3ffffff ),
fontSize: null,
fontWeight: FontWeight.w400,
fontStyle: FontStyle.normal,
),
display2: TextStyle(
color: Color( 0xb3ffffff ),
fontSize: null,
fontWeight: FontWeight.w400,
fontStyle: FontStyle.normal,
),
display1: TextStyle(
color: Color( 0xb3ffffff ),
fontSize: null,
fontWeight: FontWeight.w400,
fontStyle: FontStyle.normal,
),
headline: TextStyle(
color: Color( 0xffffffff ),
fontSize: null,
fontWeight: FontWeight.w400,
fontStyle: FontStyle.normal,
),
title: TextStyle(
color: Color( 0xffffffff ),
fontSize: null,
fontWeight: FontWeight.w400,
fontStyle: FontStyle.normal,
),
subhead: TextStyle(
color: Color( 0xffffffff ),
fontSize: null,
fontWeight: FontWeight.w400,
fontStyle: FontStyle.normal,
),
body2: TextStyle(
color: Color( 0xffffffff ),
fontSize: null,
fontWeight: FontWeight.w400,
fontStyle: FontStyle.normal,
),
body1: TextStyle(
color: Color( 0xffffffff ),
fontSize: null,
fontWeight: FontWeight.w400,
fontStyle: FontStyle.normal,
),
caption: TextStyle(
color: Color( 0xb3ffffff ),
fontSize: null,
fontWeight: FontWeight.w400,
fontStyle: FontStyle.normal,
),
button: TextStyle(
color: Color( 0xffffffff ),
fontSize: null,
fontWeight: FontWeight.w400,
fontStyle: FontStyle.normal,
),
subtitle: TextStyle(
color: Color( 0xffffffff ),
fontSize: null,
fontWeight: FontWeight.w400,
fontStyle: FontStyle.normal,
),
overline: TextStyle(
color: Color( 0xffffffff ),
fontSize: null,
fontWeight: FontWeight.w400,
fontStyle: FontStyle.normal,
),
}
Sample Code Full:
import 'package:flutter/material.dart';
final ThemeData myTheme = ThemeData(
primarySwatch: Colors.blue,
brightness: Brightness.light,
primaryColor: Color( 0xff2196f3 ),
primaryColorBrightness: Brightness.dark,
primaryColorLight: Color( 0xffbbdefb ),
primaryColorDark: Color( 0xff1976d2 ),
accentColor: Color( 0xff2196f3 ),
accentColorBrightness: Brightness.dark,
canvasColor: Color( 0xfffafafa ),
scaffoldBackgroundColor: Color( 0xfffafafa ),
bottomAppBarColor: Color( 0xffffffff ),
cardColor: Color( 0xffffffff ),
dividerColor: Color( 0x1f000000 ),
highlightColor: Color( 0x66bcbcbc ),
splashColor: Color( 0x66c8c8c8 ),
selectedRowColor: Color( 0xfff5f5f5 ),
unselectedWidgetColor: Color( 0x8a000000 ),
disabledColor: Color( 0x61000000 ),
buttonColor: Color( 0xffe0e0e0 ),
toggleableActiveColor: Color( 0xff1e88e5 ),
secondaryHeaderColor: Color( 0xffe3f2fd ),
textSelectionColor: Color( 0xff90caf9 ),
cursorColor: Color( 0xff4285f4 ),
textSelectionHandleColor: Color( 0xff64b5f6 ),
backgroundColor: Color( 0xff90caf9 ),
dialogBackgroundColor: Color( 0xffffffff ),
indicatorColor: Color( 0xff2196f3 ),
hintColor: Color( 0x8a000000 ),
errorColor: Color( 0xffd32f2f ),
buttonTheme: ButtonThemeData(
textTheme: ButtonTextTheme.normal,
minWidth: 88,
height: 36,
padding: EdgeInsets.only(top:0,bottom:0,left:16, right:16),
shape: RoundedRectangleBorder(
side: BorderSide(color: Color( 0xff000000 ), width: 0, style: BorderStyle.none, ),
borderRadius: BorderRadius.all(Radius.circular(2.0)),
)
,
alignedDropdown: false ,
buttonColor: Color( 0xffe0e0e0 ),
disabledColor: Color( 0x61000000 ),
highlightColor: Color( 0x29000000 ),
splashColor: Color( 0x1f000000 ),
focusColor: Color( 0x1f000000 ),
hoverColor: Color( 0x0a000000 ),
colorScheme: ColorScheme(
primary: Color( 0xff2196f3 ),
primaryVariant: Color( 0xff1976d2 ),
secondary: Color( 0xff2196f3 ),
secondaryVariant: Color( 0xff1976d2 ),
surface: Color( 0xffffffff ),
background: Color( 0xff90caf9 ),
error: Color( 0xffd32f2f ),
onPrimary: Color( 0xffffffff ),
onSecondary: Color( 0xffffffff ),
onSurface: Color( 0xff000000 ),
onBackground: Color( 0xffffffff ),
onError: Color( 0xffffffff ),
brightness: Brightness.light,
),
),
textTheme: TextTheme(
display4: TextStyle(
color: Color( 0x8a000000 ),
fontSize: null,
fontWeight: FontWeight.w400,
fontStyle: FontStyle.normal,
),
display3: TextStyle(
color: Color( 0x8a000000 ),
fontSize: null,
fontWeight: FontWeight.w400,
fontStyle: FontStyle.normal,
),
display2: TextStyle(
color: Color( 0x8a000000 ),
fontSize: null,
fontWeight: FontWeight.w400,
fontStyle: FontStyle.normal,
),
display1: TextStyle(
color: Color( 0x8a000000 ),
fontSize: null,
fontWeight: FontWeight.w400,
fontStyle: FontStyle.normal,
),
headline: TextStyle(
color: Color( 0xdd000000 ),
fontSize: null,
fontWeight: FontWeight.w400,
fontStyle: FontStyle.normal,
),
title: TextStyle(
color: Color( 0xdd000000 ),
fontSize: null,
fontWeight: FontWeight.w400,
fontStyle: FontStyle.normal,
),
subhead: TextStyle(
color: Color( 0xdd000000 ),
fontSize: null,
fontWeight: FontWeight.w400,
fontStyle: FontStyle.normal,
),
body2: TextStyle(
color: Color( 0xdd000000 ),
fontSize: null,
fontWeight: FontWeight.w400,
fontStyle: FontStyle.normal,
),
body1: TextStyle(
color: Color( 0xdd000000 ),
fontSize: null,
fontWeight: FontWeight.w400,
fontStyle: FontStyle.normal,
),
caption: TextStyle(
color: Color( 0x8a000000 ),
fontSize: null,
fontWeight: FontWeight.w400,
fontStyle: FontStyle.normal,
),
button: TextStyle(
color: Color( 0xdd000000 ),
fontSize: null,
fontWeight: FontWeight.w400,
fontStyle: FontStyle.normal,
),
subtitle: TextStyle(
color: Color( 0xff000000 ),
fontSize: null,
fontWeight: FontWeight.w400,
fontStyle: FontStyle.normal,
),
overline: TextStyle(
color: Color( 0xff000000 ),
fontSize: null,
fontWeight: FontWeight.w400,
fontStyle: FontStyle.normal,
),
),
primaryTextTheme: TextTheme(
display4: TextStyle(
color: Color( 0xb3ffffff ),
fontSize: null,
fontWeight: FontWeight.w400,
fontStyle: FontStyle.normal,
),
display3: TextStyle(
color: Color( 0xb3ffffff ),
fontSize: null,
fontWeight: FontWeight.w400,
fontStyle: FontStyle.normal,
),
display2: TextStyle(
color: Color( 0xb3ffffff ),
fontSize: null,
fontWeight: FontWeight.w400,
fontStyle: FontStyle.normal,
),
display1: TextStyle(
color: Color( 0xb3ffffff ),
fontSize: null,
fontWeight: FontWeight.w400,
fontStyle: FontStyle.normal,
),
headline: TextStyle(
color: Color( 0xffffffff ),
fontSize: null,
fontWeight: FontWeight.w400,
fontStyle: FontStyle.normal,
),
title: TextStyle(
color: Color( 0xffffffff ),
fontSize: null,
fontWeight: FontWeight.w400,
fontStyle: FontStyle.normal,
),
subhead: TextStyle(
color: Color( 0xffffffff ),
fontSize: null,
fontWeight: FontWeight.w400,
fontStyle: FontStyle.normal,
),
body2: TextStyle(
color: Color( 0xffffffff ),
fontSize: null,
fontWeight: FontWeight.w400,
fontStyle: FontStyle.normal,
),
body1: TextStyle(
color: Color( 0xffffffff ),
fontSize: null,
fontWeight: FontWeight.w400,
fontStyle: FontStyle.normal,
),
caption: TextStyle(
color: Color( 0xb3ffffff ),
fontSize: null,
fontWeight: FontWeight.w400,
fontStyle: FontStyle.normal,
),
button: TextStyle(
color: Color( 0xffffffff ),
fontSize: null,
fontWeight: FontWeight.w400,
fontStyle: FontStyle.normal,
),
subtitle: TextStyle(
color: Color( 0xffffffff ),
fontSize: null,
fontWeight: FontWeight.w400,
fontStyle: FontStyle.normal,
),
overline: TextStyle(
color: Color( 0xffffffff ),
fontSize: null,
fontWeight: FontWeight.w400,
fontStyle: FontStyle.normal,
),
),
accentTextTheme: TextTheme(
display4: TextStyle(
color: Color( 0xb3ffffff ),
fontSize: null,
fontWeight: FontWeight.w400,
fontStyle: FontStyle.normal,
),
display3: TextStyle(
color: Color( 0xb3ffffff ),
fontSize: null,
fontWeight: FontWeight.w400,
fontStyle: FontStyle.normal,
),
display2: TextStyle(
color: Color( 0xb3ffffff ),
fontSize: null,
fontWeight: FontWeight.w400,
fontStyle: FontStyle.normal,
),
display1: TextStyle(
color: Color( 0xb3ffffff ),
fontSize: null,
fontWeight: FontWeight.w400,
fontStyle: FontStyle.normal,
),
headline: TextStyle(
color: Color( 0xffffffff ),
fontSize: null,
fontWeight: FontWeight.w400,
fontStyle: FontStyle.normal,
),
title: TextStyle(
color: Color( 0xffffffff ),
fontSize: null,
fontWeight: FontWeight.w400,
fontStyle: FontStyle.normal,
),
subhead: TextStyle(
color: Color( 0xffffffff ),
fontSize: null,
fontWeight: FontWeight.w400,
fontStyle: FontStyle.normal,
),
body2: TextStyle(
color: Color( 0xffffffff ),
fontSize: null,
fontWeight: FontWeight.w400,
fontStyle: FontStyle.normal,
),
body1: TextStyle(
color: Color( 0xffffffff ),
fontSize: null,
fontWeight: FontWeight.w400,
fontStyle: FontStyle.normal,
),
caption: TextStyle(
color: Color( 0xb3ffffff ),
fontSize: null,
fontWeight: FontWeight.w400,
fontStyle: FontStyle.normal,
),
button: TextStyle(
color: Color( 0xffffffff ),
fontSize: null,
fontWeight: FontWeight.w400,
fontStyle: FontStyle.normal,
),
subtitle: TextStyle(
color: Color( 0xffffffff ),
fontSize: null,
fontWeight: FontWeight.w400,
fontStyle: FontStyle.normal,
),
overline: TextStyle(
color: Color( 0xffffffff ),
fontSize: null,
fontWeight: FontWeight.w400,
fontStyle: FontStyle.normal,
),
),
inputDecorationTheme: InputDecorationTheme(
labelStyle: TextStyle(
color: Color( 0xdd000000 ),
fontSize: null,
fontWeight: FontWeight.w400,
fontStyle: FontStyle.normal,
),
helperStyle: TextStyle(
color: Color( 0xdd000000 ),
fontSize: null,
fontWeight: FontWeight.w400,
fontStyle: FontStyle.normal,
),
hintStyle: TextStyle(
color: Color( 0xdd000000 ),
fontSize: null,
fontWeight: FontWeight.w400,
fontStyle: FontStyle.normal,
),
errorStyle: TextStyle(
color: Color( 0xdd000000 ),
fontSize: null,
fontWeight: FontWeight.w400,
fontStyle: FontStyle.normal,
),
errorMaxLines: null,
hasFloatingPlaceholder: true,
isDense: false,
contentPadding: EdgeInsets.only(top:12,bottom:12,left:0, right:0),
isCollapsed : false,
prefixStyle: TextStyle(
color: Color( 0xdd000000 ),
fontSize: null,
fontWeight: FontWeight.w400,
fontStyle: FontStyle.normal,
),
suffixStyle: TextStyle(
color: Color( 0xdd000000 ),
fontSize: null,
fontWeight: FontWeight.w400,
fontStyle: FontStyle.normal,
),
counterStyle: TextStyle(
color: Color( 0xdd000000 ),
fontSize: null,
fontWeight: FontWeight.w400,
fontStyle: FontStyle.normal,
),
filled: false,
fillColor: Color( 0x00000000 ),
errorBorder: UnderlineInputBorder(
borderSide: BorderSide(color: Color( 0xff000000 ), width: 1, style: BorderStyle.solid, ),
borderRadius: BorderRadius.all(Radius.circular(4.0)),
),
focusedBorder: UnderlineInputBorder(
borderSide: BorderSide(color: Color( 0xff000000 ), width: 1, style: BorderStyle.solid, ),
borderRadius: BorderRadius.all(Radius.circular(4.0)),
),
focusedErrorBorder: UnderlineInputBorder(
borderSide: BorderSide(color: Color( 0xff000000 ), width: 1, style: BorderStyle.solid, ),
borderRadius: BorderRadius.all(Radius.circular(4.0)),
),
disabledBorder: UnderlineInputBorder(
borderSide: BorderSide(color: Color( 0xff000000 ), width: 1, style: BorderStyle.solid, ),
borderRadius: BorderRadius.all(Radius.circular(4.0)),
),
enabledBorder: UnderlineInputBorder(
borderSide: BorderSide(color: Color( 0xff000000 ), width: 1, style: BorderStyle.solid, ),
borderRadius: BorderRadius.all(Radius.circular(4.0)),
),
border: UnderlineInputBorder(
borderSide: BorderSide(color: Color( 0xff000000 ), width: 1, style: BorderStyle.solid, ),
borderRadius: BorderRadius.all(Radius.circular(4.0)),
),
),
iconTheme: IconThemeData(
color: Color( 0xdd000000 ),
opacity: 1,
size: 24,
),
primaryIconTheme: IconThemeData(
color: Color( 0xffffffff ),
opacity: 1,
size: 24,
),
accentIconTheme: IconThemeData(
color: Color( 0xffffffff ),
opacity: 1,
size: 24,
),
sliderTheme: SliderThemeData(
activeTrackColor: null,
inactiveTrackColor: null,
disabledActiveTrackColor: null,
disabledInactiveTrackColor: null,
activeTickMarkColor: null,
inactiveTickMarkColor: null,
disabledActiveTickMarkColor: null,
disabledInactiveTickMarkColor: null,
thumbColor: null,
disabledThumbColor: null,
thumbShape: null(),
overlayColor: null,
valueIndicatorColor: null,
valueIndicatorShape: null(),
showValueIndicator: null,
valueIndicatorTextStyle: TextStyle(
color: Color( 0xffffffff ),
fontSize: null,
fontWeight: FontWeight.w400,
fontStyle: FontStyle.normal,
),
),
tabBarTheme: TabBarTheme(
indicatorSize: TabBarIndicatorSize.tab,
labelColor: Color( 0xffffffff ),
unselectedLabelColor: Color( 0xb2ffffff ),
),
chipTheme: ChipThemeData(
backgroundColor: Color( 0x1f000000 ),
brightness: Brightness.light,
deleteIconColor: Color( 0xde000000 ),
disabledColor: Color( 0x0c000000 ),
labelPadding: EdgeInsets.only(top:0,bottom:0,left:8, right:8),
labelStyle: TextStyle(
color: Color( 0xde000000 ),
fontSize: null,
fontWeight: FontWeight.w400,
fontStyle: FontStyle.normal,
),
padding: EdgeInsets.only(top:4,bottom:4,left:4, right:4),
secondaryLabelStyle: TextStyle(
color: Color( 0x3d000000 ),
fontSize: null,
fontWeight: FontWeight.w400,
fontStyle: FontStyle.normal,
),
secondarySelectedColor: Color( 0x3d2196f3 ),
selectedColor: Color( 0x3d000000 ),
shape: StadiumBorder( side: BorderSide(color: Color( 0xff000000 ), width: 0, style: BorderStyle.none, ) ),
),
dialogTheme: DialogTheme(
shape: RoundedRectangleBorder(
side: BorderSide(color: Color( 0xff000000 ), width: 0, style: BorderStyle.none, ),
borderRadius: BorderRadius.all(Radius.circular(0.0)),
)
),
);
I am using the date picker but it's showing a strange overflow text-overflow error.
I know the date picker uses the app Theme to style. But don't know which Theme property is used to style what in the dialogue box.
my Date picker:-
showDatePicker(
ontext: context,
initialDate: DateTime.now(),
firstDate: DateTime.now(),
astDate: DateTime.utc(2100, DateTime.now().month, DateTime.now().day),
);
my App Theme:-
ThemeData(
primaryColor: Color(0xffE6F5F1),
accentColor: Color(0xFF4EB799),
visualDensity: VisualDensity.adaptivePlatformDensity,
scaffoldBackgroundColor: Colors.white,
textTheme: TextTheme(
headline2: const TextStyle(
fontWeight: FontWeight.w500,
fontSize: 96,
letterSpacing: -1.5,
fontFamily: "Muli",
),
headline3: const TextStyle(
fontWeight: FontWeight.w500,
fontSize: 60,
letterSpacing: -0.5,
fontFamily: "Muli",
),
headline4: const TextStyle(
fontWeight: FontWeight.w500,
fontSize: 48,
letterSpacing: 0,
fontFamily: "Muli",
),
headline5: const TextStyle(
fontWeight: FontWeight.w500,
fontSize: 34,
letterSpacing: 0.25,
fontFamily: "Muli",
),
subtitle1: const TextStyle(
fontWeight: FontWeight.w500,
fontSize: 24,
letterSpacing: 0,
fontFamily: "Muli",
),
headline6: const TextStyle(
fontWeight: FontWeight.w500,
fontSize: 20,
letterSpacing: 0.15,
fontFamily: "Muli",
),
subtitle2: const TextStyle(
fontWeight: FontWeight.w400,
fontSize: 18,
letterSpacing: 0.15,
fontFamily: "Muli",
),
bodyText2: const TextStyle(
fontWeight: FontWeight.w400,
fontSize: 16,
letterSpacing: 0.5,
fontFamily: "Muli",
),
bodyText1: const TextStyle(
fontWeight: FontWeight.w400,
fontSize: 14,
letterSpacing: 0.25,
fontFamily: "Muli",
),
button: const TextStyle(
fontWeight: FontWeight.w500,
fontSize: 14,
letterSpacing: 1.25,
fontFamily: "Muli",
),
caption: const TextStyle(
fontWeight: FontWeight.w400,
fontSize: 12,
letterSpacing: 0.4,
fontFamily: "Muli",
),
overline: const TextStyle(
fontWeight: FontWeight.w500,
fontSize: 10,
letterSpacing: 1.5,
fontFamily: "Muli",
),
),
);
What is wrong here, which theme property to style what in Date picker in flutter?
In source code date_picker_dialog.dart
landscape mode use headline5
portrait mode use headline4
final TextStyle dateStyle = orientation == Orientation.landscape
? textTheme.headline5?.copyWith(color: dateColor)
: textTheme.headline4?.copyWith(color: dateColor);
...
final Widget header = DatePickerHeader(
helpText: widget.helpText ?? localizations.datePickerHelpText,
titleText: dateText,
titleStyle: dateStyle,
orientation: orientation,
isShort: orientation == Orientation.landscape,
icon: entryModeIcon,
iconTooltip: entryModeTooltip,
onIconPressed: _handleEntryModeToggle,
);
working demo
full code reduce headline4 font size
import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
#override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
primaryColor: Color(0xffE6F5F1),
accentColor: Color(0xFF4EB799),
visualDensity: VisualDensity.adaptivePlatformDensity,
scaffoldBackgroundColor: Colors.white,
textTheme: TextTheme(
headline2: const TextStyle(
fontWeight: FontWeight.w500,
fontSize: 96,
letterSpacing: -1.5,
fontFamily: "Muli",
),
headline3: const TextStyle(
fontWeight: FontWeight.w500,
fontSize: 60,
letterSpacing: -0.5,
fontFamily: "Muli",
),
headline4: const TextStyle(
fontWeight: FontWeight.w500,
fontSize: 30,
letterSpacing: 0,
fontFamily: "Muli",
),
headline5: const TextStyle(
fontWeight: FontWeight.w500,
fontSize: 34,
letterSpacing: 0.25,
fontFamily: "Muli",
),
subtitle1: const TextStyle(
fontWeight: FontWeight.w500,
fontSize: 24,
letterSpacing: 0,
fontFamily: "Muli",
),
headline6: const TextStyle(
fontWeight: FontWeight.w500,
fontSize: 20,
letterSpacing: 0.15,
fontFamily: "Muli",
),
subtitle2: const TextStyle(
fontWeight: FontWeight.w400,
fontSize: 18,
letterSpacing: 0.15,
fontFamily: "Muli",
),
bodyText2: const TextStyle(
fontWeight: FontWeight.w400,
fontSize: 16,
letterSpacing: 0.5,
fontFamily: "Muli",
),
bodyText1: const TextStyle(
fontWeight: FontWeight.w400,
fontSize: 14,
letterSpacing: 0.25,
fontFamily: "Muli",
),
button: const TextStyle(
fontWeight: FontWeight.w500,
fontSize: 14,
letterSpacing: 1.25,
fontFamily: "Muli",
),
caption: const TextStyle(
fontWeight: FontWeight.w400,
fontSize: 12,
letterSpacing: 0.4,
fontFamily: "Muli",
),
overline: const TextStyle(
fontWeight: FontWeight.w500,
fontSize: 10,
letterSpacing: 1.5,
fontFamily: "Muli",
),
),
),
home: MyHomePage(title: 'Flutter Demo Home Page'),
);
}
}
class MyHomePage extends StatefulWidget {
MyHomePage({Key key, this.title}) : super(key: key);
final String title;
#override
_MyHomePageState createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
int _counter = 0;
void _incrementCounter() {
showDatePicker(
context: context,
initialDate: DateTime.now(),
firstDate: DateTime.now(),
lastDate: DateTime.utc(2100, DateTime.now().month, DateTime.now().day),
);
setState(() {
_counter++;
});
}
#override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text(widget.title),
),
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Text(
'You have pushed the button this many times:',
),
Text(
'$_counter',
style: Theme.of(context).textTheme.headline4,
),
],
),
),
floatingActionButton: FloatingActionButton(
onPressed: _incrementCounter,
tooltip: 'Increment',
child: Icon(Icons.add),
),
);
}
}