Migrate TextTheme to 2018 APIs (#48547)

This commit is contained in:
Hans Muller 2020-01-24 19:03:01 -08:00 committed by Flutter GitHub Bot
parent 77fb0c1ade
commit bc5c46438a
118 changed files with 1138 additions and 749 deletions

View File

@ -363,7 +363,7 @@ class UserHeader extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.stretch, crossAxisAlignment: CrossAxisAlignment.stretch,
children: <Widget>[ children: <Widget>[
RichText(text: TextSpan( RichText(text: TextSpan(
style: Theme.of(context).textTheme.body1, style: Theme.of(context).textTheme.bodyText2,
children: <TextSpan>[ children: <TextSpan>[
TextSpan(text: userName, style: const TextStyle(fontWeight: FontWeight.bold)), TextSpan(text: userName, style: const TextStyle(fontWeight: FontWeight.bold)),
const TextSpan(text: ' shared a new '), const TextSpan(text: ' shared a new '),
@ -462,8 +462,8 @@ class ItemImageBox extends StatelessWidget {
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch, crossAxisAlignment: CrossAxisAlignment.stretch,
children: <Widget>[ children: <Widget>[
Text('Artisans of Southern India', style: Theme.of(context).textTheme.body2), Text('Artisans of Southern India', style: Theme.of(context).textTheme.bodyText1),
Text('Silk Spinners', style: Theme.of(context).textTheme.body1), Text('Silk Spinners', style: Theme.of(context).textTheme.bodyText2),
Text('Sivaganga, Tamil Nadu', style: Theme.of(context).textTheme.caption), Text('Sivaganga, Tamil Nadu', style: Theme.of(context).textTheme.caption),
], ],
), ),
@ -506,7 +506,7 @@ class ItemGalleryBox extends StatelessWidget {
child: Container( child: Container(
color: Theme.of(context).primaryColor, color: Theme.of(context).primaryColor,
child: Center( child: Center(
child: Text(tabName, style: Theme.of(context).textTheme.headline.copyWith(color: Colors.white)), child: Text(tabName, style: Theme.of(context).textTheme.headline5.copyWith(color: Colors.white)),
), ),
), ),
), ),

View File

@ -100,7 +100,7 @@ class _MyHomePageState extends State<MyHomePage> {
), ),
Text( Text(
'$_counter', '$_counter',
style: Theme.of(context).textTheme.display1, style: Theme.of(context).textTheme.headline4,
), ),
], ],
), ),

View File

@ -100,7 +100,7 @@ class _MyHomePageState extends State<MyHomePage> {
), ),
Text( Text(
'$_counter', '$_counter',
style: Theme.of(context).textTheme.display1, style: Theme.of(context).textTheme.headline4,
), ),
], ],
), ),

View File

@ -100,7 +100,7 @@ class _MyHomePageState extends State<MyHomePage> {
), ),
Text( Text(
'$_counter', '$_counter',
style: Theme.of(context).textTheme.display1, style: Theme.of(context).textTheme.headline4,
), ),
], ],
), ),

View File

@ -446,7 +446,7 @@ class _FocusDemoState extends State<FocusDemo> {
debugLabel: 'Scope', debugLabel: 'Scope',
autofocus: true, autofocus: true,
child: DefaultTextStyle( child: DefaultTextStyle(
style: textTheme.display1, style: textTheme.headline4,
child: Scaffold( child: Scaffold(
appBar: AppBar( appBar: AppBar(
title: const Text('Actions Demo'), title: const Text('Actions Demo'),

View File

@ -240,7 +240,7 @@ class CardCollectionState extends State<CardCollection> {
padding: const EdgeInsets.only(left: 72.0), padding: const EdgeInsets.only(left: 72.0),
height: 128.0, height: 128.0,
alignment: const Alignment(-1.0, 0.5), alignment: const Alignment(-1.0, 0.5),
child: Text('Swipe Away: ${_cardModels.length}', style: Theme.of(context).primaryTextTheme.title), child: Text('Swipe Away: ${_cardModels.length}', style: Theme.of(context).primaryTextTheme.headline6),
), ),
); );
} }
@ -305,7 +305,7 @@ class CardCollectionState extends State<CardCollection> {
rightArrowIcon = Opacity(opacity: 0.1, child: rightArrowIcon); rightArrowIcon = Opacity(opacity: 0.1, child: rightArrowIcon);
final ThemeData theme = Theme.of(context); final ThemeData theme = Theme.of(context);
final TextStyle backgroundTextStyle = theme.primaryTextTheme.title; final TextStyle backgroundTextStyle = theme.primaryTextTheme.headline6;
// The background Widget appears behind the Dismissible card when the card // The background Widget appears behind the Dismissible card when the card
// moves to the left or right. The Positioned widget ensures that the // moves to the left or right. The Positioned widget ensures that the

View File

@ -100,7 +100,7 @@ class ExampleDragSource extends StatelessWidget {
size *= kHeavyMultiplier; size *= kHeavyMultiplier;
final Widget contents = DefaultTextStyle( final Widget contents = DefaultTextStyle(
style: Theme.of(context).textTheme.body1, style: Theme.of(context).textTheme.bodyText2,
textAlign: TextAlign.center, textAlign: TextAlign.center,
child: Dot( child: Dot(
color: color, color: color,
@ -188,7 +188,7 @@ class MovableBall extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final Widget ball = DefaultTextStyle( final Widget ball = DefaultTextStyle(
style: Theme.of(context).primaryTextTheme.body1, style: Theme.of(context).primaryTextTheme.bodyText2,
textAlign: TextAlign.center, textAlign: TextAlign.center,
child: Dot( child: Dot(
key: kBallKey, key: kBallKey,

View File

@ -149,7 +149,7 @@ class _FocusDemoState extends State<FocusDemo> {
onKey: _handleKeyPress, onKey: _handleKeyPress,
autofocus: true, autofocus: true,
child: DefaultTextStyle( child: DefaultTextStyle(
style: textTheme.display1, style: textTheme.headline4,
child: Scaffold( child: Scaffold(
appBar: AppBar( appBar: AppBar(
title: const Text('Focus Demo'), title: const Text('Focus Demo'),

View File

@ -56,7 +56,7 @@ class _HoverDemoState extends State<HoverDemo> {
final TextTheme textTheme = Theme.of(context).textTheme; final TextTheme textTheme = Theme.of(context).textTheme;
return DefaultTextStyle( return DefaultTextStyle(
style: textTheme.display1, style: textTheme.headline4,
child: Scaffold( child: Scaffold(
appBar: AppBar( appBar: AppBar(
title: const Text('Hover Demo'), title: const Text('Hover Demo'),

View File

@ -79,12 +79,12 @@ class _HardwareKeyDemoState extends State<RawKeyboardDemo> {
onTap: () { onTap: () {
_focusNode.requestFocus(); _focusNode.requestFocus();
}, },
child: Text('Tap to focus', style: textTheme.display1), child: Text('Tap to focus', style: textTheme.headline4),
); );
} }
if (_event == null) { if (_event == null) {
return Text('Press a key', style: textTheme.display1); return Text('Press a key', style: textTheme.headline4);
} }
final RawKeyEventData data = _event.data; final RawKeyEventData data = _event.data;
@ -137,7 +137,7 @@ class _HardwareKeyDemoState extends State<RawKeyboardDemo> {
} }
} }
return DefaultTextStyle( return DefaultTextStyle(
style: textTheme.subhead, style: textTheme.subtitle1,
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: dataText, children: dataText,

View File

@ -91,7 +91,7 @@ abstract class KeyboardKey extends Diagnosticable {
/// color: Colors.white, /// color: Colors.white,
/// alignment: Alignment.center, /// alignment: Alignment.center,
/// child: DefaultTextStyle( /// child: DefaultTextStyle(
/// style: textTheme.display1, /// style: textTheme.headline4,
/// child: RawKeyboardListener( /// child: RawKeyboardListener(
/// focusNode: _focusNode, /// focusNode: _focusNode,
/// onKey: _handleKeyEvent, /// onKey: _handleKeyEvent,
@ -371,7 +371,7 @@ class LogicalKeyboardKey extends KeyboardKey {
/// color: Colors.white, /// color: Colors.white,
/// alignment: Alignment.center, /// alignment: Alignment.center,
/// child: DefaultTextStyle( /// child: DefaultTextStyle(
/// style: textTheme.display1, /// style: textTheme.headline4,
/// child: RawKeyboardListener( /// child: RawKeyboardListener(
/// focusNode: _focusNode, /// focusNode: _focusNode,
/// onKey: _handleKeyEvent, /// onKey: _handleKeyEvent,

View File

@ -170,7 +170,7 @@ class CardItem extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
TextStyle textStyle = Theme.of(context).textTheme.display1; TextStyle textStyle = Theme.of(context).textTheme.headline4;
if (selected) if (selected)
textStyle = textStyle.copyWith(color: Colors.lightGreenAccent[400]); textStyle = textStyle.copyWith(color: Colors.lightGreenAccent[400]);
return Padding( return Padding(

View File

@ -97,7 +97,7 @@ class ChoiceCard extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final TextStyle textStyle = Theme.of(context).textTheme.display1; final TextStyle textStyle = Theme.of(context).textTheme.headline4;
return Card( return Card(
color: Colors.white, color: Colors.white,
child: Center( child: Center(

View File

@ -78,7 +78,7 @@ class ChoiceCard extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final TextStyle textStyle = Theme.of(context).textTheme.display1; final TextStyle textStyle = Theme.of(context).textTheme.headline4;
return Card( return Card(
color: Colors.white, color: Colors.white,
child: Center( child: Center(

View File

@ -59,7 +59,7 @@ class ChoiceCard extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final TextStyle textStyle = Theme.of(context).textTheme.display1; final TextStyle textStyle = Theme.of(context).textTheme.headline4;
return Card( return Card(
color: Colors.white, color: Colors.white,
child: Center( child: Center(

View File

@ -97,8 +97,8 @@ class PaletteTabView extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final TextTheme textTheme = Theme.of(context).textTheme; final TextTheme textTheme = Theme.of(context).textTheme;
final TextStyle whiteTextStyle = textTheme.body1.copyWith(color: Colors.white); final TextStyle whiteTextStyle = textTheme.bodyText2.copyWith(color: Colors.white);
final TextStyle blackTextStyle = textTheme.body1.copyWith(color: Colors.black); final TextStyle blackTextStyle = textTheme.bodyText2.copyWith(color: Colors.black);
return Scrollbar( return Scrollbar(
child: ListView( child: ListView(
itemExtent: kColorItemHeight, itemExtent: kColorItemHeight,

View File

@ -20,7 +20,7 @@ class _ContactCategory extends StatelessWidget {
border: Border(bottom: BorderSide(color: themeData.dividerColor)) border: Border(bottom: BorderSide(color: themeData.dividerColor))
), ),
child: DefaultTextStyle( child: DefaultTextStyle(
style: Theme.of(context).textTheme.subhead, style: Theme.of(context).textTheme.subtitle1,
child: SafeArea( child: SafeArea(
top: false, top: false,
bottom: false, bottom: false,

View File

@ -115,8 +115,8 @@ class FruitPage extends StatelessWidget {
), ),
Text( Text(
' ¬ ', ' ¬ ',
// TODO(larche): Replace textTheme.display3.color with a ColorScheme value when known. // TODO(larche): Replace textTheme.headline2.color with a ColorScheme value when known.
style: textTheme.overline.apply(color: textTheme.display3.color), style: textTheme.overline.apply(color: textTheme.headline2.color),
), ),
Text( Text(
'CULTURE', 'CULTURE',
@ -127,13 +127,13 @@ class FruitPage extends StatelessWidget {
const SizedBox(height: 10), const SizedBox(height: 10),
Text( Text(
'Quince for Wisdom, Persimmon for Luck, Pomegranate for Love', 'Quince for Wisdom, Persimmon for Luck, Pomegranate for Love',
style: textTheme.display1, style: textTheme.headline4,
), ),
const SizedBox(height: 10), const SizedBox(height: 10),
Text( Text(
'How these crazy fruits sweetened our hearts, relationships, ' 'How these crazy fruits sweetened our hearts, relationships, '
'and puffed pastries', 'and puffed pastries',
style: textTheme.body1, style: textTheme.bodyText2,
), ),
Padding( Padding(
padding: const EdgeInsets.symmetric(vertical: 16), padding: const EdgeInsets.symmetric(vertical: 16),
@ -149,7 +149,7 @@ class FruitPage extends StatelessWidget {
const SizedBox(width: 12), const SizedBox(width: 12),
Text( Text(
'by', 'by',
style: textTheme.display3, style: textTheme.headline2,
), ),
const SizedBox(width: 4), const SizedBox(width: 4),
const Text( const Text(
@ -166,7 +166,7 @@ class FruitPage extends StatelessWidget {
), ),
Text( Text(
'$paragraph1\n\n$paragraph2', '$paragraph1\n\n$paragraph2',
style: textTheme.body2, style: textTheme.bodyText1,
), ),
], ],
), ),
@ -194,7 +194,7 @@ TextTheme _buildTextTheme(TextTheme base) {
theme = theme.apply(displayColor: Colors.black); theme = theme.apply(displayColor: Colors.black);
theme = theme.copyWith( theme = theme.copyWith(
display1: base.display1.copyWith( headline4: base.headline4.copyWith(
fontFamily: 'Merriweather', fontFamily: 'Merriweather',
fontStyle: FontStyle.italic, fontStyle: FontStyle.italic,
fontSize: 28, fontSize: 28,
@ -202,21 +202,21 @@ TextTheme _buildTextTheme(TextTheme base) {
color: Colors.black, color: Colors.black,
height: .88, height: .88,
), ),
display3: base.display3.copyWith( headline2: base.headline2.copyWith(
fontFamily: 'LibreFranklin', fontFamily: 'LibreFranklin',
fontSize: 18, fontSize: 18,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
color: Colors.black.withAlpha(153), color: Colors.black.withAlpha(153),
), ),
headline: base.headline.copyWith(fontWeight: FontWeight.w500), headline5: base.headline5.copyWith(fontWeight: FontWeight.w500),
body1: base.body1.copyWith( bodyText2: base.bodyText2.copyWith(
fontFamily: 'Merriweather', fontFamily: 'Merriweather',
fontSize: 14, fontSize: 14,
fontWeight: FontWeight.w300, fontWeight: FontWeight.w300,
color: const Color(0xFF666666), color: const Color(0xFF666666),
height: 1.11, height: 1.11,
), ),
body2: base.body2.copyWith( bodyText1: base.bodyText1.copyWith(
fontFamily: 'Merriweather', fontFamily: 'Merriweather',
fontSize: 16, fontSize: 16,
fontWeight: FontWeight.w300, fontWeight: FontWeight.w300,

View File

@ -185,7 +185,7 @@ class BackdropPanel extends StatelessWidget {
padding: const EdgeInsetsDirectional.only(start: 16.0), padding: const EdgeInsetsDirectional.only(start: 16.0),
alignment: AlignmentDirectional.centerStart, alignment: AlignmentDirectional.centerStart,
child: DefaultTextStyle( child: DefaultTextStyle(
style: theme.textTheme.subhead, style: theme.textTheme.subtitle1,
child: Tooltip( child: Tooltip(
message: 'Tap to dismiss', message: 'Tap to dismiss',
child: title, child: title,
@ -212,7 +212,7 @@ class BackdropTitle extends AnimatedWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
final Animation<double> animation = listenable as Animation<double>; final Animation<double> animation = listenable as Animation<double>;
return DefaultTextStyle( return DefaultTextStyle(
style: Theme.of(context).primaryTextTheme.title, style: Theme.of(context).primaryTextTheme.headline6,
softWrap: false, softWrap: false,
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
child: Stack( child: Stack(
@ -359,8 +359,8 @@ class _BackdropDemoState extends State<BackdropDemo> with SingleTickerProviderSt
children: <Widget>[ children: <Widget>[
ListTileTheme( ListTileTheme(
iconColor: theme.primaryIconTheme.color, iconColor: theme.primaryIconTheme.color,
textColor: theme.primaryTextTheme.title.color.withOpacity(0.6), textColor: theme.primaryTextTheme.headline6.color.withOpacity(0.6),
selectedColor: theme.primaryTextTheme.title.color, selectedColor: theme.primaryTextTheme.headline6.color,
child: Padding( child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 16.0), padding: const EdgeInsets.symmetric(horizontal: 16.0),
child: Column( child: Column(

View File

@ -253,7 +253,7 @@ class _RadioItem<T> extends StatelessWidget {
}, },
child: Text( child: Text(
value.title, value.title,
style: theme.textTheme.subhead, style: theme.textTheme.subtitle1,
), ),
), ),
), ),
@ -323,7 +323,7 @@ class _Heading extends StatelessWidget {
alignment: AlignmentDirectional.centerStart, alignment: AlignmentDirectional.centerStart,
child: Text( child: Text(
text, text,
style: theme.textTheme.body1.copyWith( style: theme.textTheme.bodyText2.copyWith(
color: theme.primaryColor, color: theme.primaryColor,
), ),
), ),

View File

@ -243,7 +243,7 @@ class SectionTitle extends StatelessWidget {
padding: const EdgeInsets.fromLTRB(4.0, 4.0, 4.0, 12.0), padding: const EdgeInsets.fromLTRB(4.0, 4.0, 4.0, 12.0),
child: Align( child: Align(
alignment: Alignment.centerLeft, alignment: Alignment.centerLeft,
child: Text(title, style: Theme.of(context).textTheme.subhead), child: Text(title, style: Theme.of(context).textTheme.subtitle1),
), ),
); );
} }
@ -259,8 +259,8 @@ class TravelDestinationContent extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final ThemeData theme = Theme.of(context); final ThemeData theme = Theme.of(context);
final TextStyle titleStyle = theme.textTheme.headline.copyWith(color: Colors.white); final TextStyle titleStyle = theme.textTheme.headline5.copyWith(color: Colors.white);
final TextStyle descriptionStyle = theme.textTheme.subhead; final TextStyle descriptionStyle = theme.textTheme.subtitle1;
return Column( return Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,

View File

@ -291,7 +291,7 @@ class _ChipDemoState extends State<ChipDemo> {
child: Center( child: Center(
child: Text( child: Text(
_createResult(), _createResult(),
style: theme.textTheme.title, style: theme.textTheme.headline6,
), ),
), ),
), ),

View File

@ -87,7 +87,7 @@ class _DateTimePicker extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final TextStyle valueStyle = Theme.of(context).textTheme.title; final TextStyle valueStyle = Theme.of(context).textTheme.headline6;
return Row( return Row(
crossAxisAlignment: CrossAxisAlignment.end, crossAxisAlignment: CrossAxisAlignment.end,
children: <Widget>[ children: <Widget>[
@ -149,13 +149,13 @@ class _DateAndTimePickerDemoState extends State<DateAndTimePickerDemo> {
labelText: 'Event name', labelText: 'Event name',
border: OutlineInputBorder(), border: OutlineInputBorder(),
), ),
style: Theme.of(context).textTheme.display1, style: Theme.of(context).textTheme.headline4,
), ),
TextField( TextField(
decoration: const InputDecoration( decoration: const InputDecoration(
labelText: 'Location', labelText: 'Location',
), ),
style: Theme.of(context).textTheme.display1.copyWith(fontSize: 20.0), style: Theme.of(context).textTheme.headline4.copyWith(fontSize: 20.0),
), ),
_DateTimePicker( _DateTimePicker(
labelText: 'From', labelText: 'From',

View File

@ -83,7 +83,7 @@ class DialogDemoState extends State<DialogDemo> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final ThemeData theme = Theme.of(context); final ThemeData theme = Theme.of(context);
final TextStyle dialogTextStyle = theme.textTheme.subhead.copyWith(color: theme.textTheme.caption.color); final TextStyle dialogTextStyle = theme.textTheme.subtitle1.copyWith(color: theme.textTheme.caption.color);
return Scaffold( return Scaffold(
key: _scaffoldKey, key: _scaffoldKey,

View File

@ -234,7 +234,7 @@ class _DrawerDemoState extends State<DrawerDemo> with TickerProviderStateMixin {
Padding( Padding(
padding: const EdgeInsets.only(top: 8.0), padding: const EdgeInsets.only(top: 8.0),
child: Text('Tap here to open the drawer', child: Text('Tap here to open the drawer',
style: Theme.of(context).textTheme.subhead, style: Theme.of(context).textTheme.subtitle1,
), ),
), ),
], ],

View File

@ -57,7 +57,7 @@ class DualHeaderWithHint extends StatelessWidget {
alignment: Alignment.centerLeft, alignment: Alignment.centerLeft,
child: Text( child: Text(
name, name,
style: textTheme.body1.copyWith(fontSize: 15.0), style: textTheme.bodyText2.copyWith(fontSize: 15.0),
), ),
), ),
), ),

View File

@ -32,7 +32,7 @@ class DateTimeItem extends StatelessWidget {
final ThemeData theme = Theme.of(context); final ThemeData theme = Theme.of(context);
return DefaultTextStyle( return DefaultTextStyle(
style: theme.textTheme.subhead, style: theme.textTheme.subtitle1,
child: Row( child: Row(
children: <Widget>[ children: <Widget>[
Expanded( Expanded(
@ -115,7 +115,7 @@ class FullScreenDialogDemoState extends State<FullScreenDialogDemo> {
return true; return true;
final ThemeData theme = Theme.of(context); final ThemeData theme = Theme.of(context);
final TextStyle dialogTextStyle = theme.textTheme.subhead.copyWith(color: theme.textTheme.caption.color); final TextStyle dialogTextStyle = theme.textTheme.subtitle1.copyWith(color: theme.textTheme.caption.color);
return await showDialog<bool>( return await showDialog<bool>(
context: context, context: context,
@ -153,7 +153,7 @@ class FullScreenDialogDemoState extends State<FullScreenDialogDemo> {
title: Text(_hasName ? _eventName : 'Event Name TBD'), title: Text(_hasName ? _eventName : 'Event Name TBD'),
actions: <Widget> [ actions: <Widget> [
FlatButton( FlatButton(
child: Text('SAVE', style: theme.textTheme.body1.copyWith(color: Colors.white)), child: Text('SAVE', style: theme.textTheme.bodyText2.copyWith(color: Colors.white)),
onPressed: () { onPressed: () {
Navigator.pop(context, DismissDialogAction.save); Navigator.pop(context, DismissDialogAction.save);
}, },
@ -174,7 +174,7 @@ class FullScreenDialogDemoState extends State<FullScreenDialogDemo> {
labelText: 'Event name', labelText: 'Event name',
filled: true, filled: true,
), ),
style: theme.textTheme.headline, style: theme.textTheme.headline5,
onChanged: (String value) { onChanged: (String value) {
setState(() { setState(() {
_hasName = value.isNotEmpty; _hasName = value.isNotEmpty;

View File

@ -109,7 +109,7 @@ class _IconsDemoCard extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final ThemeData theme = Theme.of(context); final ThemeData theme = Theme.of(context);
final TextStyle textStyle = theme.textTheme.subhead.copyWith(color: theme.textTheme.caption.color); final TextStyle textStyle = theme.textTheme.subtitle1.copyWith(color: theme.textTheme.caption.color);
return Card( return Card(
child: DefaultTextStyle( child: DefaultTextStyle(
style: textStyle, style: textStyle,

View File

@ -109,7 +109,7 @@ class _ProgressIndicatorDemoState extends State<ProgressIndicatorDemo> with Sing
body: Center( body: Center(
child: SingleChildScrollView( child: SingleChildScrollView(
child: DefaultTextStyle( child: DefaultTextStyle(
style: Theme.of(context).textTheme.title, style: Theme.of(context).textTheme.headline6,
child: GestureDetector( child: GestureDetector(
onTap: _handleTap, onTap: _handleTap,
behavior: HitTestBehavior.opaque, behavior: HitTestBehavior.opaque,

View File

@ -207,7 +207,7 @@ class _ListDemoState extends State<ReorderableListDemo> {
header: _itemType != _ReorderableListType.threeLine header: _itemType != _ReorderableListType.threeLine
? Padding( ? Padding(
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
child: Text('Header of the list', style: Theme.of(context).textTheme.headline)) child: Text('Header of the list', style: Theme.of(context).textTheme.headline5))
: null, : null,
onReorder: _onReorder, onReorder: _onReorder,
reverse: _reverse, reverse: _reverse,

View File

@ -247,7 +247,7 @@ class _ResultCard extends StatelessWidget {
Text(title), Text(title),
Text( Text(
'$integer', '$integer',
style: theme.textTheme.headline.copyWith(fontSize: 72.0), style: theme.textTheme.headline5.copyWith(fontSize: 72.0),
), ),
], ],
), ),
@ -276,11 +276,11 @@ class _SuggestionList extends StatelessWidget {
title: RichText( title: RichText(
text: TextSpan( text: TextSpan(
text: suggestion.substring(0, query.length), text: suggestion.substring(0, query.length),
style: theme.textTheme.subhead.copyWith(fontWeight: FontWeight.bold), style: theme.textTheme.subtitle1.copyWith(fontWeight: FontWeight.bold),
children: <TextSpan>[ children: <TextSpan>[
TextSpan( TextSpan(
text: suggestion.substring(query.length), text: suggestion.substring(query.length),
style: theme.textTheme.subhead, style: theme.textTheme.subtitle1,
), ),
], ],
), ),

View File

@ -320,7 +320,7 @@ class _SlidersState extends State<_Sliders> {
valueIndicatorColor: Colors.deepPurpleAccent, valueIndicatorColor: Colors.deepPurpleAccent,
thumbShape: _CustomThumbShape(), thumbShape: _CustomThumbShape(),
valueIndicatorShape: _CustomValueIndicatorShape(), valueIndicatorShape: _CustomValueIndicatorShape(),
valueIndicatorTextStyle: theme.accentTextTheme.body2.copyWith(color: theme.colorScheme.onSurface), valueIndicatorTextStyle: theme.accentTextTheme.bodyText1.copyWith(color: theme.colorScheme.onSurface),
), ),
child: Slider( child: Slider(
value: _discreteCustomValue, value: _discreteCustomValue,

View File

@ -127,7 +127,7 @@ class _CardDataItem extends StatelessWidget {
Center( Center(
child: Text( child: Text(
data.title, data.title,
style: Theme.of(context).textTheme.title, style: Theme.of(context).textTheme.headline6,
), ),
), ),
], ],

View File

@ -76,7 +76,7 @@ class _TabsFabDemoState extends State<TabsFabDemo> with SingleTickerProviderStat
), ),
child: Padding( child: Padding(
padding: const EdgeInsets.all(32.0), padding: const EdgeInsets.all(32.0),
child: Text(_explanatoryText, style: Theme.of(context).textTheme.subhead), child: Text(_explanatoryText, style: Theme.of(context).textTheme.subtitle1),
), ),
); );
}); });

View File

@ -30,10 +30,10 @@ class TooltipDemo extends StatelessWidget {
bottom: false, bottom: false,
child: ListView( child: ListView(
children: <Widget>[ children: <Widget>[
Text(_introText, style: theme.textTheme.subhead), Text(_introText, style: theme.textTheme.subtitle1),
Row( Row(
children: <Widget>[ children: <Widget>[
Text('Long press the ', style: theme.textTheme.subhead), Text('Long press the ', style: theme.textTheme.subtitle1),
Tooltip( Tooltip(
message: 'call icon', message: 'call icon',
child: Icon( child: Icon(
@ -42,7 +42,7 @@ class TooltipDemo extends StatelessWidget {
color: theme.iconTheme.color, color: theme.iconTheme.color,
), ),
), ),
Text(' icon.', style: theme.textTheme.subhead), Text(' icon.', style: theme.textTheme.subtitle1),
], ],
), ),
Center( Center(

View File

@ -99,10 +99,10 @@ ThemeData _buildShrineTheme() {
TextTheme _buildShrineTextTheme(TextTheme base) { TextTheme _buildShrineTextTheme(TextTheme base) {
return base.copyWith( return base.copyWith(
headline: base.headline.copyWith(fontWeight: FontWeight.w500), headline5: base.headline5.copyWith(fontWeight: FontWeight.w500),
title: base.title.copyWith(fontSize: 18.0), headline6: base.headline6.copyWith(fontSize: 18.0),
caption: base.caption.copyWith(fontWeight: FontWeight.w400, fontSize: 14.0), caption: base.caption.copyWith(fontWeight: FontWeight.w400, fontSize: 14.0),
body2: base.body2.copyWith(fontWeight: FontWeight.w500, fontSize: 16.0), bodyText1: base.bodyText1.copyWith(fontWeight: FontWeight.w500, fontSize: 16.0),
button: base.button.copyWith(fontWeight: FontWeight.w500, fontSize: 14.0), button: base.button.copyWith(fontWeight: FontWeight.w500, fontSize: 14.0),
).apply( ).apply(
fontFamily: 'Raleway', fontFamily: 'Raleway',

View File

@ -131,7 +131,7 @@ class _BackdropTitle extends AnimatedWidget {
); );
return DefaultTextStyle( return DefaultTextStyle(
style: Theme.of(context).primaryTextTheme.title, style: Theme.of(context).primaryTextTheme.headline6,
softWrap: false, softWrap: false,
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
child: Row(children: <Widget>[ child: Row(children: <Widget>[

View File

@ -35,7 +35,7 @@ class CategoryMenuPage extends StatelessWidget {
const SizedBox(height: 16.0), const SizedBox(height: 16.0),
Text( Text(
categoryString, categoryString,
style: theme.textTheme.body2, style: theme.textTheme.bodyText1,
textAlign: TextAlign.center, textAlign: TextAlign.center,
), ),
const SizedBox(height: 14.0), const SizedBox(height: 14.0),
@ -50,7 +50,7 @@ class CategoryMenuPage extends StatelessWidget {
padding: const EdgeInsets.symmetric(vertical: 16.0), padding: const EdgeInsets.symmetric(vertical: 16.0),
child: Text( child: Text(
categoryString, categoryString,
style: theme.textTheme.body2.copyWith( style: theme.textTheme.bodyText1.copyWith(
color: kShrineBrown900.withAlpha(153) color: kShrineBrown900.withAlpha(153)
), ),
textAlign: TextAlign.center, textAlign: TextAlign.center,

View File

@ -50,7 +50,7 @@ class _LoginPageState extends State<LoginPage> {
const SizedBox(height: 16.0), const SizedBox(height: 16.0),
Text( Text(
'SHRINE', 'SHRINE',
style: Theme.of(context).textTheme.headline, style: Theme.of(context).textTheme.headline5,
), ),
], ],
), ),

View File

@ -57,7 +57,7 @@ class _ShoppingCartPageState extends State<ShoppingCartPage> {
), ),
Text( Text(
'CART', 'CART',
style: localTheme.textTheme.subhead.copyWith(fontWeight: FontWeight.w600), style: localTheme.textTheme.subtitle1.copyWith(fontWeight: FontWeight.w600),
), ),
const SizedBox(width: 16.0), const SizedBox(width: 16.0),
Text('${model.totalCartQuantity} ITEMS'), Text('${model.totalCartQuantity} ITEMS'),
@ -108,8 +108,8 @@ class ShoppingCartSummary extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final TextStyle smallAmountStyle = Theme.of(context).textTheme.body1.copyWith(color: kShrineBrown600); final TextStyle smallAmountStyle = Theme.of(context).textTheme.bodyText2.copyWith(color: kShrineBrown600);
final TextStyle largeAmountStyle = Theme.of(context).textTheme.display1; final TextStyle largeAmountStyle = Theme.of(context).textTheme.headline4;
final NumberFormat formatter = NumberFormat.simpleCurrency( final NumberFormat formatter = NumberFormat.simpleCurrency(
decimalDigits: 2, decimalDigits: 2,
locale: Localizations.localeOf(context).toString(), locale: Localizations.localeOf(context).toString(),
@ -242,7 +242,7 @@ class ShoppingCartRow extends StatelessWidget {
), ),
Text( Text(
product.name, product.name,
style: localTheme.textTheme.subhead.copyWith(fontWeight: FontWeight.w600), style: localTheme.textTheme.subtitle1.copyWith(fontWeight: FontWeight.w600),
), ),
], ],
), ),

View File

@ -49,15 +49,15 @@ class TypographyDemo extends StatelessWidget {
final TextTheme textTheme = Theme.of(context).textTheme; final TextTheme textTheme = Theme.of(context).textTheme;
final List<Widget> styleItems = <Widget>[ final List<Widget> styleItems = <Widget>[
if (MediaQuery.of(context).size.width > 500.0) if (MediaQuery.of(context).size.width > 500.0)
TextStyleItem(name: 'Display 4', style: textTheme.display4, text: 'Light 112sp'), TextStyleItem(name: 'Headline 1', style: textTheme.headline1, text: 'Light 112sp'),
TextStyleItem(name: 'Display 3', style: textTheme.display3, text: 'Regular 56sp'), TextStyleItem(name: 'Headline 2', style: textTheme.headline2, text: 'Regular 56sp'),
TextStyleItem(name: 'Display 2', style: textTheme.display2, text: 'Regular 45sp'), TextStyleItem(name: 'Headline 3', style: textTheme.headline3, text: 'Regular 45sp'),
TextStyleItem(name: 'Display 1', style: textTheme.display1, text: 'Regular 34sp'), TextStyleItem(name: 'Headline 4', style: textTheme.headline4, text: 'Regular 34sp'),
TextStyleItem(name: 'Headline', style: textTheme.headline, text: 'Regular 24sp'), TextStyleItem(name: 'Headline 5', style: textTheme.headline5, text: 'Regular 24sp'),
TextStyleItem(name: 'Title', style: textTheme.title, text: 'Medium 20sp'), TextStyleItem(name: 'Headline 6', style: textTheme.headline6, text: 'Medium 20sp'),
TextStyleItem(name: 'Subheading', style: textTheme.subhead, text: 'Regular 16sp'), TextStyleItem(name: 'Subtitle 1', style: textTheme.subtitle1, text: 'Regular 16sp'),
TextStyleItem(name: 'Body 2', style: textTheme.body2, text: 'Medium 14sp'), TextStyleItem(name: 'Body 1', style: textTheme.bodyText1, text: 'Medium 14sp'),
TextStyleItem(name: 'Body 1', style: textTheme.body1, text: 'Regular 14sp'), TextStyleItem(name: 'Body 2', style: textTheme.bodyText2, text: 'Regular 14sp'),
TextStyleItem(name: 'Caption', style: textTheme.caption, text: 'Regular 12sp'), TextStyleItem(name: 'Caption', style: textTheme.caption, text: 'Regular 12sp'),
TextStyleItem(name: 'Button', style: textTheme.button, text: 'MEDIUM (ALL CAPS) 14sp'), TextStyleItem(name: 'Button', style: textTheme.button, text: 'MEDIUM (ALL CAPS) 14sp'),
]; ];

View File

@ -34,8 +34,8 @@ class _LinkTextSpan extends TextSpan {
void showGalleryAboutDialog(BuildContext context) { void showGalleryAboutDialog(BuildContext context) {
final ThemeData themeData = Theme.of(context); final ThemeData themeData = Theme.of(context);
final TextStyle aboutTextStyle = themeData.textTheme.body2; final TextStyle aboutTextStyle = themeData.textTheme.bodyText1;
final TextStyle linkStyle = themeData.textTheme.body2.copyWith(color: themeData.accentColor); final TextStyle linkStyle = themeData.textTheme.bodyText1.copyWith(color: themeData.accentColor);
showAboutDialog( showAboutDialog(
context: context, context: context,

View File

@ -151,7 +151,7 @@ class _BackAppBar extends StatelessWidget {
return IconTheme.merge( return IconTheme.merge(
data: theme.primaryIconTheme, data: theme.primaryIconTheme,
child: DefaultTextStyle( child: DefaultTextStyle(
style: theme.primaryTextTheme.title, style: theme.primaryTextTheme.headline6,
child: SizedBox( child: SizedBox(
height: _kBackAppBarHeight, height: _kBackAppBarHeight,
child: Row( child: Row(

View File

@ -133,7 +133,7 @@ class TabbedComponentDemoScaffold extends StatelessWidget {
Padding( Padding(
padding: const EdgeInsets.all(16.0), padding: const EdgeInsets.all(16.0),
child: Text(demo.description, child: Text(demo.description,
style: Theme.of(context).textTheme.subhead, style: Theme.of(context).textTheme.subtitle1,
), ),
), ),
Expanded(child: demo.demoWidget), Expanded(child: demo.demoWidget),

View File

@ -83,7 +83,7 @@ class _CategoryItem extends StatelessWidget {
child: Text( child: Text(
category.name, category.name,
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: theme.textTheme.subhead.copyWith( style: theme.textTheme.subtitle1.copyWith(
fontFamily: 'GoogleSans', fontFamily: 'GoogleSans',
color: isDark ? Colors.white : _kFlutterBlue, color: isDark ? Colors.white : _kFlutterBlue,
), ),
@ -212,14 +212,14 @@ class _DemoItem extends StatelessWidget {
children: <Widget>[ children: <Widget>[
Text( Text(
demo.title, demo.title,
style: theme.textTheme.subhead.copyWith( style: theme.textTheme.subtitle1.copyWith(
color: isDark ? Colors.white : const Color(0xFF202124), color: isDark ? Colors.white : const Color(0xFF202124),
), ),
), ),
if (demo.subtitle != null) if (demo.subtitle != null)
Text( Text(
demo.subtitle, demo.subtitle,
style: theme.textTheme.body1.copyWith( style: theme.textTheme.bodyText2.copyWith(
color: isDark ? Colors.white : const Color(0xFF60646B) color: isDark ? Colors.white : const Color(0xFF60646B)
), ),
), ),

View File

@ -177,7 +177,7 @@ class _FlatButton extends StatelessWidget {
padding: EdgeInsets.zero, padding: EdgeInsets.zero,
onPressed: onPressed, onPressed: onPressed,
child: DefaultTextStyle( child: DefaultTextStyle(
style: Theme.of(context).primaryTextTheme.subhead, style: Theme.of(context).primaryTextTheme.subtitle1,
child: child, child: child,
), ),
); );
@ -194,7 +194,7 @@ class _Heading extends StatelessWidget {
final ThemeData theme = Theme.of(context); final ThemeData theme = Theme.of(context);
return _OptionsItem( return _OptionsItem(
child: DefaultTextStyle( child: DefaultTextStyle(
style: theme.textTheme.title.copyWith( style: theme.textTheme.headline6.copyWith(
fontFamily: 'GoogleSans', fontFamily: 'GoogleSans',
color: theme.colorScheme.onPrimary, color: theme.colorScheme.onPrimary,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
@ -232,7 +232,7 @@ class _ThemeModeItem extends StatelessWidget {
const Text('Theme'), const Text('Theme'),
Text( Text(
modeLabels[options.themeMode], modeLabels[options.themeMode],
style: Theme.of(context).primaryTextTheme.body1, style: Theme.of(context).primaryTextTheme.bodyText2,
), ),
], ],
), ),
@ -279,7 +279,7 @@ class _TextScaleFactorItem extends StatelessWidget {
const Text('Text size'), const Text('Text size'),
Text( Text(
options.textScaleFactor.label, options.textScaleFactor.label,
style: Theme.of(context).primaryTextTheme.body1, style: Theme.of(context).primaryTextTheme.bodyText2,
), ),
], ],
), ),
@ -325,7 +325,7 @@ class _VisualDensityItem extends StatelessWidget {
const Text('Visual density'), const Text('Visual density'),
Text( Text(
options.visualDensity.label, options.visualDensity.label,
style: Theme.of(context).primaryTextTheme.body1, style: Theme.of(context).primaryTextTheme.bodyText2,
), ),
], ],
), ),
@ -432,7 +432,7 @@ class _PlatformItem extends StatelessWidget {
const Text('Platform mechanics'), const Text('Platform mechanics'),
Text( Text(
_platformLabel(options.platform), _platformLabel(options.platform),
style: Theme.of(context).primaryTextTheme.body1, style: Theme.of(context).primaryTextTheme.bodyText2,
), ),
], ],
), ),
@ -515,7 +515,7 @@ class GalleryOptionsPage extends StatelessWidget {
final ThemeData theme = Theme.of(context); final ThemeData theme = Theme.of(context);
return DefaultTextStyle( return DefaultTextStyle(
style: theme.primaryTextTheme.subhead, style: theme.primaryTextTheme.subtitle1,
child: ListView( child: ListView(
padding: const EdgeInsets.only(bottom: 124.0), padding: const EdgeInsets.only(bottom: 124.0),
children: <Widget>[ children: <Widget>[

View File

@ -9,7 +9,7 @@ final ThemeData kDarkGalleryTheme = _buildDarkTheme();
TextTheme _buildTextTheme(TextTheme base) { TextTheme _buildTextTheme(TextTheme base) {
return base.copyWith( return base.copyWith(
title: base.title.copyWith( headline6: base.headline6.copyWith(
fontFamily: 'GoogleSans', fontFamily: 'GoogleSans',
), ),
); );

View File

@ -49,7 +49,7 @@ class UpdaterState extends State<Updater> {
Widget _buildDialog(BuildContext context) { Widget _buildDialog(BuildContext context) {
final ThemeData theme = Theme.of(context); final ThemeData theme = Theme.of(context);
final TextStyle dialogTextStyle = final TextStyle dialogTextStyle =
theme.textTheme.subhead.copyWith(color: theme.textTheme.caption.color); theme.textTheme.subtitle1.copyWith(color: theme.textTheme.caption.color);
return AlertDialog( return AlertDialog(
title: const Text('Update Flutter Gallery?'), title: const Text('Update Flutter Gallery?'),
content: Text('A newer version is available.', style: dialogTextStyle), content: Text('A newer version is available.', style: dialogTextStyle),

View File

@ -202,7 +202,7 @@ class _MyHomePageState extends State<MyHomePage> with TickerProviderStateMixin {
), ),
Text( Text(
'$_counter', '$_counter',
style: Theme.of(context).textTheme.display1, style: Theme.of(context).textTheme.headline4,
), ),
], ],
), ),

View File

@ -21,7 +21,7 @@ class _StockSymbolView extends StatelessWidget {
if (stock.percentChange > 0) if (stock.percentChange > 0)
changeInPrice = '+' + changeInPrice; changeInPrice = '+' + changeInPrice;
final TextStyle headings = Theme.of(context).textTheme.body2; final TextStyle headings = Theme.of(context).textTheme.bodyText1;
return Container( return Container(
padding: const EdgeInsets.all(20.0), padding: const EdgeInsets.all(20.0),
child: Column( child: Column(
@ -31,7 +31,7 @@ class _StockSymbolView extends StatelessWidget {
Text( Text(
stock.symbol, stock.symbol,
key: ValueKey<String>('${stock.symbol}_symbol_name'), key: ValueKey<String>('${stock.symbol}_symbol_name'),
style: Theme.of(context).textTheme.display2, style: Theme.of(context).textTheme.headline3,
), ),
arrow, arrow,
], ],

View File

@ -413,7 +413,7 @@ class Cubic extends Curve {
/// child: CircleAvatar( /// child: CircleAvatar(
/// backgroundColor: Colors.yellow, /// backgroundColor: Colors.yellow,
/// child: DefaultTextStyle( /// child: DefaultTextStyle(
/// style: Theme.of(context).textTheme.title, /// style: Theme.of(context).textTheme.headline6,
/// child: Text("B"), // Buzz, buzz! /// child: Text("B"), // Buzz, buzz!
/// ), /// ),
/// ), /// ),

View File

@ -41,7 +41,7 @@ import 'theme.dart';
/// ```dart /// ```dart
/// ///
/// Widget build(BuildContext context) { /// Widget build(BuildContext context) {
/// final TextStyle textStyle = Theme.of(context).textTheme.body1; /// final TextStyle textStyle = Theme.of(context).textTheme.bodyText2;
/// final List<Widget> aboutBoxChildren = <Widget>[ /// final List<Widget> aboutBoxChildren = <Widget>[
/// SizedBox(height: 24), /// SizedBox(height: 24),
/// RichText( /// RichText(
@ -374,8 +374,8 @@ class AboutDialog extends StatelessWidget {
padding: const EdgeInsets.symmetric(horizontal: 24.0), padding: const EdgeInsets.symmetric(horizontal: 24.0),
child: ListBody( child: ListBody(
children: <Widget>[ children: <Widget>[
Text(name, style: Theme.of(context).textTheme.headline), Text(name, style: Theme.of(context).textTheme.headline5),
Text(version, style: Theme.of(context).textTheme.body1), Text(version, style: Theme.of(context).textTheme.bodyText2),
Container(height: 18.0), Container(height: 18.0),
Text(applicationLegalese ?? '', style: Theme.of(context).textTheme.caption), Text(applicationLegalese ?? '', style: Theme.of(context).textTheme.caption),
], ],
@ -576,13 +576,13 @@ class _LicensePageState extends State<LicensePage> {
child: ListView( child: ListView(
padding: const EdgeInsets.symmetric(horizontal: 8.0, vertical: 12.0), padding: const EdgeInsets.symmetric(horizontal: 8.0, vertical: 12.0),
children: <Widget>[ children: <Widget>[
Text(name, style: Theme.of(context).textTheme.headline, textAlign: TextAlign.center), Text(name, style: Theme.of(context).textTheme.headline5, textAlign: TextAlign.center),
if (icon != null) IconTheme(data: Theme.of(context).iconTheme, child: icon), if (icon != null) IconTheme(data: Theme.of(context).iconTheme, child: icon),
Text(version, style: Theme.of(context).textTheme.body1, textAlign: TextAlign.center), Text(version, style: Theme.of(context).textTheme.bodyText2, textAlign: TextAlign.center),
Container(height: 18.0), Container(height: 18.0),
Text(widget.applicationLegalese ?? '', style: Theme.of(context).textTheme.caption, textAlign: TextAlign.center), Text(widget.applicationLegalese ?? '', style: Theme.of(context).textTheme.caption, textAlign: TextAlign.center),
Container(height: 18.0), Container(height: 18.0),
Text('Powered by Flutter', style: Theme.of(context).textTheme.body1, textAlign: TextAlign.center), Text('Powered by Flutter', style: Theme.of(context).textTheme.bodyText2, textAlign: TextAlign.center),
Container(height: 24.0), Container(height: 24.0),
..._licenses, ..._licenses,
if (!_loaded) if (!_loaded)

View File

@ -434,12 +434,12 @@ class _AppBarState extends State<AppBar> {
IconThemeData actionsIconTheme = widget.actionsIconTheme IconThemeData actionsIconTheme = widget.actionsIconTheme
?? appBarTheme.actionsIconTheme ?? appBarTheme.actionsIconTheme
?? overallIconTheme; ?? overallIconTheme;
TextStyle centerStyle = widget.textTheme?.title TextStyle centerStyle = widget.textTheme?.headline6
?? appBarTheme.textTheme?.title ?? appBarTheme.textTheme?.headline6
?? theme.primaryTextTheme.title; ?? theme.primaryTextTheme.headline6;
TextStyle sideStyle = widget.textTheme?.body1 TextStyle sideStyle = widget.textTheme?.bodyText2
?? appBarTheme.textTheme?.body1 ?? appBarTheme.textTheme?.bodyText2
?? theme.primaryTextTheme.body1; ?? theme.primaryTextTheme.bodyText2;
if (widget.toolbarOpacity != 1.0) { if (widget.toolbarOpacity != 1.0) {
final double opacity = const Interval(0.25, 1.0, curve: Curves.fastOutSlowIn).transform(widget.toolbarOpacity); final double opacity = const Interval(0.25, 1.0, curve: Curves.fastOutSlowIn).transform(widget.toolbarOpacity);

View File

@ -57,7 +57,7 @@ class MaterialBanner extends StatelessWidget {
/// Style for the text in the [content] of the [MaterialBanner]. /// Style for the text in the [content] of the [MaterialBanner].
/// ///
/// If `null`, [MaterialBannerThemeData.contentTextStyle] is used. If that is /// If `null`, [MaterialBannerThemeData.contentTextStyle] is used. If that is
/// also `null`, [ThemeData.textTheme.body1] is used. /// also `null`, [ThemeData.textTheme.bodyText2] is used.
final TextStyle contentTextStyle; final TextStyle contentTextStyle;
/// The set of actions that are displayed at the bottom or trailing side of /// The set of actions that are displayed at the bottom or trailing side of
@ -128,7 +128,7 @@ class MaterialBanner extends StatelessWidget {
?? theme.colorScheme.surface; ?? theme.colorScheme.surface;
final TextStyle textStyle = contentTextStyle final TextStyle textStyle = contentTextStyle
?? bannerTheme.contentTextStyle ?? bannerTheme.contentTextStyle
?? theme.textTheme.body1; ?? theme.textTheme.bodyText2;
return Container( return Container(
color: backgroundColor, color: backgroundColor,

View File

@ -510,7 +510,7 @@ class ChipThemeData extends Diagnosticable {
final ChipThemeData defaultData = ChipThemeData.fromDefaults( final ChipThemeData defaultData = ChipThemeData.fromDefaults(
secondaryColor: defaultTheme.primaryColor, secondaryColor: defaultTheme.primaryColor,
brightness: defaultTheme.brightness, brightness: defaultTheme.brightness,
labelStyle: defaultTheme.textTheme.body2, labelStyle: defaultTheme.textTheme.bodyText1,
); );
properties.add(ColorProperty('backgroundColor', backgroundColor, defaultValue: defaultData.backgroundColor)); properties.add(ColorProperty('backgroundColor', backgroundColor, defaultValue: defaultData.backgroundColor));
properties.add(ColorProperty('deleteIconColor', deleteIconColor, defaultValue: defaultData.deleteIconColor)); properties.add(ColorProperty('deleteIconColor', deleteIconColor, defaultValue: defaultData.deleteIconColor));

View File

@ -166,7 +166,7 @@ class CircleAvatar extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
assert(debugCheckHasMediaQuery(context)); assert(debugCheckHasMediaQuery(context));
final ThemeData theme = Theme.of(context); final ThemeData theme = Theme.of(context);
TextStyle textStyle = theme.primaryTextTheme.subhead.copyWith(color: foregroundColor); TextStyle textStyle = theme.primaryTextTheme.subtitle1.copyWith(color: foregroundColor);
Color effectiveBackgroundColor = backgroundColor; Color effectiveBackgroundColor = backgroundColor;
if (effectiveBackgroundColor == null) { if (effectiveBackgroundColor == null) {
switch (ThemeData.estimateBrightnessForColor(textStyle.color)) { switch (ThemeData.estimateBrightnessForColor(textStyle.color)) {

View File

@ -90,8 +90,8 @@ class _DatePickerHeader extends StatelessWidget {
yearColor = mode == DatePickerMode.year ? Colors.white : Colors.white70; yearColor = mode == DatePickerMode.year ? Colors.white : Colors.white70;
break; break;
} }
final TextStyle dayStyle = headerTextTheme.display1.copyWith(color: dayColor); final TextStyle dayStyle = headerTextTheme.headline4.copyWith(color: dayColor);
final TextStyle yearStyle = headerTextTheme.subhead.copyWith(color: yearColor); final TextStyle yearStyle = headerTextTheme.subtitle1.copyWith(color: yearColor);
Color backgroundColor; Color backgroundColor;
switch (themeData.brightness) { switch (themeData.brightness) {
@ -409,21 +409,21 @@ class DayPicker extends StatelessWidget {
|| (selectableDayPredicate != null && !selectableDayPredicate(dayToBuild)); || (selectableDayPredicate != null && !selectableDayPredicate(dayToBuild));
BoxDecoration decoration; BoxDecoration decoration;
TextStyle itemStyle = themeData.textTheme.body1; TextStyle itemStyle = themeData.textTheme.bodyText2;
final bool isSelectedDay = selectedDate.year == year && selectedDate.month == month && selectedDate.day == day; final bool isSelectedDay = selectedDate.year == year && selectedDate.month == month && selectedDate.day == day;
if (isSelectedDay) { if (isSelectedDay) {
// The selected day gets a circle background highlight, and a contrasting text color. // The selected day gets a circle background highlight, and a contrasting text color.
itemStyle = themeData.accentTextTheme.body2; itemStyle = themeData.accentTextTheme.bodyText1;
decoration = BoxDecoration( decoration = BoxDecoration(
color: themeData.accentColor, color: themeData.accentColor,
shape: BoxShape.circle, shape: BoxShape.circle,
); );
} else if (disabled) { } else if (disabled) {
itemStyle = themeData.textTheme.body1.copyWith(color: themeData.disabledColor); itemStyle = themeData.textTheme.bodyText2.copyWith(color: themeData.disabledColor);
} else if (currentDate.year == year && currentDate.month == month && currentDate.day == day) { } else if (currentDate.year == year && currentDate.month == month && currentDate.day == day) {
// The current day gets a different text color. // The current day gets a different text color.
itemStyle = themeData.textTheme.body2.copyWith(color: themeData.accentColor); itemStyle = themeData.textTheme.bodyText1.copyWith(color: themeData.accentColor);
} }
Widget dayWidget = Container( Widget dayWidget = Container(
@ -471,7 +471,7 @@ class DayPicker extends StatelessWidget {
child: ExcludeSemantics( child: ExcludeSemantics(
child: Text( child: Text(
localizations.formatMonthYear(displayedMonth), localizations.formatMonthYear(displayedMonth),
style: themeData.textTheme.subhead, style: themeData.textTheme.subtitle1,
), ),
), ),
), ),
@ -824,7 +824,7 @@ class _YearPickerState extends State<YearPicker> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
assert(debugCheckHasMaterial(context)); assert(debugCheckHasMaterial(context));
final ThemeData themeData = Theme.of(context); final ThemeData themeData = Theme.of(context);
final TextStyle style = themeData.textTheme.body1; final TextStyle style = themeData.textTheme.bodyText2;
return ListView.builder( return ListView.builder(
dragStartBehavior: widget.dragStartBehavior, dragStartBehavior: widget.dragStartBehavior,
controller: scrollController, controller: scrollController,
@ -834,7 +834,7 @@ class _YearPickerState extends State<YearPicker> {
final int year = widget.firstDate.year + index; final int year = widget.firstDate.year + index;
final bool isSelected = year == widget.selectedDate.year; final bool isSelected = year == widget.selectedDate.year;
final TextStyle itemStyle = isSelected final TextStyle itemStyle = isSelected
? themeData.textTheme.headline.copyWith(color: themeData.accentColor) ? themeData.textTheme.headline5.copyWith(color: themeData.accentColor)
: style; : style;
return InkWell( return InkWell(
key: ValueKey<int>(year), key: ValueKey<int>(year),

View File

@ -253,7 +253,7 @@ class AlertDialog extends StatelessWidget {
/// Style for the text in the [title] of this [AlertDialog]. /// Style for the text in the [title] of this [AlertDialog].
/// ///
/// If null, [DialogTheme.titleTextStyle] is used, if that's null, defaults to /// If null, [DialogTheme.titleTextStyle] is used, if that's null, defaults to
/// [ThemeData.textTheme.title]. /// [ThemeData.textTheme.headline6].
final TextStyle titleTextStyle; final TextStyle titleTextStyle;
/// The (optional) content of the dialog is displayed in the center of the /// The (optional) content of the dialog is displayed in the center of the
@ -276,7 +276,7 @@ class AlertDialog extends StatelessWidget {
/// Style for the text in the [content] of this [AlertDialog]. /// Style for the text in the [content] of this [AlertDialog].
/// ///
/// If null, [DialogTheme.contentTextStyle] is used, if that's null, defaults /// If null, [DialogTheme.contentTextStyle] is used, if that's null, defaults
/// to [ThemeData.textTheme.subhead]. /// to [ThemeData.textTheme.subtitle1].
final TextStyle contentTextStyle; final TextStyle contentTextStyle;
/// The (optional) set of actions that are displayed at the bottom of the /// The (optional) set of actions that are displayed at the bottom of the
@ -421,7 +421,7 @@ class AlertDialog extends StatelessWidget {
titleWidget = Padding( titleWidget = Padding(
padding: titlePadding ?? EdgeInsets.fromLTRB(24.0, 24.0, 24.0, content == null ? 20.0 : 0.0), padding: titlePadding ?? EdgeInsets.fromLTRB(24.0, 24.0, 24.0, content == null ? 20.0 : 0.0),
child: DefaultTextStyle( child: DefaultTextStyle(
style: titleTextStyle ?? dialogTheme.titleTextStyle ?? theme.textTheme.title, style: titleTextStyle ?? dialogTheme.titleTextStyle ?? theme.textTheme.headline6,
child: Semantics( child: Semantics(
child: title, child: title,
namesRoute: true, namesRoute: true,
@ -434,7 +434,7 @@ class AlertDialog extends StatelessWidget {
contentWidget = Padding( contentWidget = Padding(
padding: contentPadding, padding: contentPadding,
child: DefaultTextStyle( child: DefaultTextStyle(
style: contentTextStyle ?? dialogTheme.contentTextStyle ?? theme.textTheme.subhead, style: contentTextStyle ?? dialogTheme.contentTextStyle ?? theme.textTheme.subtitle1,
child: content, child: content,
), ),
); );
@ -747,7 +747,7 @@ class SimpleDialog extends StatelessWidget {
Padding( Padding(
padding: titlePadding, padding: titlePadding,
child: DefaultTextStyle( child: DefaultTextStyle(
style: theme.textTheme.title, style: theme.textTheme.headline6,
child: Semantics(namesRoute: true, child: title), child: Semantics(namesRoute: true, child: title),
), ),
), ),

View File

@ -19,7 +19,7 @@ import 'theme.dart';
/// a border radius of 2.0 on all corners. /// a border radius of 2.0 on all corners.
/// ///
/// [titleTextStyle] and [contentTextStyle] are used in [AlertDialog]s. /// [titleTextStyle] and [contentTextStyle] are used in [AlertDialog]s.
/// If null, they default to [TextTheme.title] and [TextTheme.subhead], /// If null, they default to [TextTheme.headline6] and [TextTheme.subtitle1],
/// respectively. /// respectively.
/// ///
/// See also: /// See also:
@ -53,12 +53,12 @@ class DialogTheme extends Diagnosticable {
/// Used to configure the [DefaultTextStyle] for the [AlertDialog.title] widget. /// Used to configure the [DefaultTextStyle] for the [AlertDialog.title] widget.
/// ///
/// If null, defaults to [ThemeData.textTheme.title]. /// If null, defaults to [ThemeData.textTheme.headline6].
final TextStyle titleTextStyle; final TextStyle titleTextStyle;
/// Used to configure the [DefaultTextStyle] for the [AlertDialog.content] widget. /// Used to configure the [DefaultTextStyle] for the [AlertDialog.content] widget.
/// ///
/// If null, defaults to [ThemeData.textTheme.subhead]. /// If null, defaults to [ThemeData.textTheme.subtitle1].
final TextStyle contentTextStyle; final TextStyle contentTextStyle;
/// Creates a copy of this object but with the given fields replaced with the /// Creates a copy of this object but with the given fields replaced with the

View File

@ -91,7 +91,7 @@ class DrawerHeader extends StatelessWidget {
duration: duration, duration: duration,
curve: curve, curve: curve,
child: child == null ? null : DefaultTextStyle( child: child == null ? null : DefaultTextStyle(
style: theme.textTheme.body2, style: theme.textTheme.bodyText1,
child: MediaQuery.removePadding( child: MediaQuery.removePadding(
context: context, context: context,
removeTop: true, removeTop: true,

View File

@ -958,7 +958,7 @@ class DropdownButton<T> extends StatefulWidget {
/// ``` /// ```
/// {@end-tool} /// {@end-tool}
/// ///
/// Defaults to the [TextTheme.subhead] value of the current /// Defaults to the [TextTheme.subtitle1] value of the current
/// [ThemeData.textTheme] of the current [Theme]. /// [ThemeData.textTheme] of the current [Theme].
final TextStyle style; final TextStyle style;
@ -1128,7 +1128,7 @@ class _DropdownButtonState<T> extends State<DropdownButton<T>> with WidgetsBindi
} }
} }
TextStyle get _textStyle => widget.style ?? Theme.of(context).textTheme.subhead; TextStyle get _textStyle => widget.style ?? Theme.of(context).textTheme.subtitle1;
void _handleTap() { void _handleTap() {
final RenderBox itemBox = context.findRenderObject() as RenderBox; final RenderBox itemBox = context.findRenderObject() as RenderBox;
@ -1184,7 +1184,7 @@ class _DropdownButtonState<T> extends State<DropdownButton<T>> with WidgetsBindi
// Similarly, we don't reduce the height of the button so much that its icon // Similarly, we don't reduce the height of the button so much that its icon
// would be clipped. // would be clipped.
double get _denseButtonHeight { double get _denseButtonHeight {
final double fontSize = _textStyle.fontSize ?? Theme.of(context).textTheme.subhead.fontSize; final double fontSize = _textStyle.fontSize ?? Theme.of(context).textTheme.subtitle1.fontSize;
return math.max(fontSize, math.max(widget.iconSize, _kDenseButtonHeight)); return math.max(fontSize, math.max(widget.iconSize, _kDenseButtonHeight));
} }

View File

@ -191,7 +191,7 @@ class _ExpansionTileState extends State<ExpansionTile> with SingleTickerProvider
_borderColorTween _borderColorTween
..end = theme.dividerColor; ..end = theme.dividerColor;
_headerColorTween _headerColorTween
..begin = theme.textTheme.subhead.color ..begin = theme.textTheme.subtitle1.color
..end = theme.accentColor; ..end = theme.accentColor;
_iconColorTween _iconColorTween
..begin = theme.unselectedWidgetColor ..begin = theme.unselectedWidgetColor

View File

@ -367,7 +367,7 @@ class _FlexibleSpaceBarState extends State<FlexibleSpaceBar> {
final double opacity = settings.toolbarOpacity; final double opacity = settings.toolbarOpacity;
if (opacity > 0.0) { if (opacity > 0.0) {
TextStyle titleStyle = theme.primaryTextTheme.title; TextStyle titleStyle = theme.primaryTextTheme.headline6;
titleStyle = titleStyle.copyWith( titleStyle = titleStyle.copyWith(
color: titleStyle.color.withOpacity(opacity) color: titleStyle.color.withOpacity(opacity)
); );

View File

@ -93,7 +93,7 @@ class GridTileBar extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
DefaultTextStyle( DefaultTextStyle(
style: darkTheme.textTheme.subhead, style: darkTheme.textTheme.subtitle1,
softWrap: false, softWrap: false,
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
child: title, child: title,
@ -110,7 +110,7 @@ class GridTileBar extends StatelessWidget {
else if (title != null || subtitle != null) else if (title != null || subtitle != null)
Expanded( Expanded(
child: DefaultTextStyle( child: DefaultTextStyle(
style: darkTheme.textTheme.subhead, style: darkTheme.textTheme.subtitle1,
softWrap: false, softWrap: false,
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
child: title ?? subtitle, child: title ?? subtitle,

View File

@ -1763,7 +1763,7 @@ class InputDecorator extends StatefulWidget {
/// The style on which to base the label, hint, counter, and error styles /// The style on which to base the label, hint, counter, and error styles
/// if the [decoration] does not provide explicit styles. /// if the [decoration] does not provide explicit styles.
/// ///
/// If null, `baseStyle` defaults to the `subhead` style from the /// If null, `baseStyle` defaults to the `subtitle1` style from the
/// current [Theme], see [ThemeData.textTheme]. /// current [Theme], see [ThemeData.textTheme].
/// ///
/// The [TextStyle.textBaseline] of the [baseStyle] is used to determine /// The [TextStyle.textBaseline] of the [baseStyle] is used to determine
@ -2049,7 +2049,7 @@ class _InputDecoratorState extends State<InputDecorator> with TickerProviderStat
// The base style for the inline label or hint when they're displayed "inline", // The base style for the inline label or hint when they're displayed "inline",
// i.e. when they appear in place of the empty text field. // i.e. when they appear in place of the empty text field.
TextStyle _getInlineStyle(ThemeData themeData) { TextStyle _getInlineStyle(ThemeData themeData) {
return themeData.textTheme.subhead.merge(widget.baseStyle) return themeData.textTheme.subtitle1.merge(widget.baseStyle)
.copyWith(color: decoration.enabled ? themeData.hintColor : themeData.disabledColor); .copyWith(color: decoration.enabled ? themeData.hintColor : themeData.disabledColor);
} }
@ -2057,7 +2057,7 @@ class _InputDecoratorState extends State<InputDecorator> with TickerProviderStat
final Color color = decoration.errorText != null final Color color = decoration.errorText != null
? decoration.errorStyle?.color ?? themeData.errorColor ? decoration.errorStyle?.color ?? themeData.errorColor
: _getActiveColor(themeData); : _getActiveColor(themeData);
final TextStyle style = themeData.textTheme.subhead.merge(widget.baseStyle); final TextStyle style = themeData.textTheme.subtitle1.merge(widget.baseStyle);
return style return style
.copyWith(color: decoration.enabled ? color : themeData.disabledColor) .copyWith(color: decoration.enabled ? color : themeData.disabledColor)
.merge(decoration.labelStyle); .merge(decoration.labelStyle);

View File

@ -17,8 +17,8 @@ import 'theme.dart';
/// Defines the title font used for [ListTile] descendants of a [ListTileTheme]. /// Defines the title font used for [ListTile] descendants of a [ListTileTheme].
/// ///
/// List tiles that appear in a [Drawer] use the theme's [TextTheme.body2] /// List tiles that appear in a [Drawer] use the theme's [TextTheme.bodyText1]
/// text style, which is a little smaller than the theme's [TextTheme.subhead] /// text style, which is a little smaller than the theme's [TextTheme.subtitle1]
/// text style, which is used by default. /// text style, which is used by default.
enum ListTileStyle { enum ListTileStyle {
/// Use a title font that's appropriate for a [ListTile] in a list. /// Use a title font that's appropriate for a [ListTile] in a list.
@ -806,14 +806,14 @@ class ListTile extends StatelessWidget {
if (tileTheme != null) { if (tileTheme != null) {
switch (tileTheme.style) { switch (tileTheme.style) {
case ListTileStyle.drawer: case ListTileStyle.drawer:
style = theme.textTheme.body2; style = theme.textTheme.bodyText1;
break; break;
case ListTileStyle.list: case ListTileStyle.list:
style = theme.textTheme.subhead; style = theme.textTheme.subtitle1;
break; break;
} }
} else { } else {
style = theme.textTheme.subhead; style = theme.textTheme.subtitle1;
} }
final Color color = _textColor(theme, tileTheme, style.color); final Color color = _textColor(theme, tileTheme, style.color);
return _isDenseLayout(tileTheme) return _isDenseLayout(tileTheme)
@ -822,7 +822,7 @@ class ListTile extends StatelessWidget {
} }
TextStyle _subtitleTextStyle(ThemeData theme, ListTileTheme tileTheme) { TextStyle _subtitleTextStyle(ThemeData theme, ListTileTheme tileTheme) {
final TextStyle style = theme.textTheme.body1; final TextStyle style = theme.textTheme.bodyText2;
final Color color = _textColor(theme, tileTheme, theme.textTheme.caption.color); final Color color = _textColor(theme, tileTheme, theme.textTheme.caption.color);
return _isDenseLayout(tileTheme) return _isDenseLayout(tileTheme)
? style.copyWith(color: color, fontSize: 12.0) ? style.copyWith(color: color, fontSize: 12.0)

View File

@ -351,7 +351,7 @@ class _MaterialState extends State<Material> with TickerProviderStateMixin {
Widget contents = widget.child; Widget contents = widget.child;
if (contents != null) { if (contents != null) {
contents = AnimatedDefaultTextStyle( contents = AnimatedDefaultTextStyle(
style: widget.textStyle ?? Theme.of(context).textTheme.body1, style: widget.textStyle ?? Theme.of(context).textTheme.bodyText2,
duration: widget.animationDuration, duration: widget.animationDuration,
child: contents, child: contents,
); );

View File

@ -439,8 +439,8 @@ class PaginatedDataTableState extends State<PaginatedDataTable> {
// These typographic styles aren't quite the regular ones. We pick the closest ones from the regular // These typographic styles aren't quite the regular ones. We pick the closest ones from the regular
// list and then tweak them appropriately. // list and then tweak them appropriately.
// See https://material.io/design/components/data-tables.html#tables-within-cards // See https://material.io/design/components/data-tables.html#tables-within-cards
style: _selectedRowCount > 0 ? themeData.textTheme.subhead.copyWith(color: themeData.accentColor) style: _selectedRowCount > 0 ? themeData.textTheme.subtitle1.copyWith(color: themeData.accentColor)
: themeData.textTheme.title.copyWith(fontWeight: FontWeight.w400), : themeData.textTheme.headline6.copyWith(fontWeight: FontWeight.w400),
child: IconTheme.merge( child: IconTheme.merge(
data: const IconThemeData( data: const IconThemeData(
opacity: 0.54 opacity: 0.54

View File

@ -239,7 +239,7 @@ class PopupMenuItem<T> extends PopupMenuEntry<T> {
/// The text style of the popup menu item. /// The text style of the popup menu item.
/// ///
/// If this property is null, then [PopupMenuThemeData.textStyle] is used. /// If this property is null, then [PopupMenuThemeData.textStyle] is used.
/// If [PopupMenuThemeData.textStyle] is also null, then [ThemeData.textTheme.subhead] is used. /// If [PopupMenuThemeData.textStyle] is also null, then [ThemeData.textTheme.subtitle1] is used.
final TextStyle textStyle; final TextStyle textStyle;
/// The widget below this widget in the tree. /// The widget below this widget in the tree.
@ -297,7 +297,7 @@ class PopupMenuItemState<T, W extends PopupMenuItem<T>> extends State<W> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
final ThemeData theme = Theme.of(context); final ThemeData theme = Theme.of(context);
final PopupMenuThemeData popupMenuTheme = PopupMenuTheme.of(context); final PopupMenuThemeData popupMenuTheme = PopupMenuTheme.of(context);
TextStyle style = widget.textStyle ?? popupMenuTheme.textStyle ?? theme.textTheme.subhead; TextStyle style = widget.textStyle ?? popupMenuTheme.textStyle ?? theme.textTheme.subtitle1;
if (!widget.enabled) if (!widget.enabled)
style = style.copyWith(color: theme.disabledColor); style = style.copyWith(color: theme.disabledColor);

View File

@ -273,7 +273,7 @@ class RangeSlider extends StatefulWidget {
/// There are two labels: one for the start thumb and one for the end thumb. /// There are two labels: one for the start thumb and one for the end thumb.
/// ///
/// Each label is rendered using the active [ThemeData]'s /// Each label is rendered using the active [ThemeData]'s
/// [ThemeData.textTheme.body2] text style, with the /// [ThemeData.textTheme.bodyText1] text style, with the
/// theme data's [ThemeData.colorScheme.onPrimaryColor]. The label's text /// theme data's [ThemeData.colorScheme.onPrimaryColor]. The label's text
/// style can be overridden with [SliderThemeData.valueIndicatorTextStyle]. /// style can be overridden with [SliderThemeData.valueIndicatorTextStyle].
/// ///
@ -564,7 +564,7 @@ class _RangeSliderState extends State<RangeSlider> with TickerProviderStateMixin
overlayShape: sliderTheme.overlayShape ?? _defaultOverlayShape, overlayShape: sliderTheme.overlayShape ?? _defaultOverlayShape,
rangeValueIndicatorShape: sliderTheme.rangeValueIndicatorShape ?? _defaultValueIndicatorShape, rangeValueIndicatorShape: sliderTheme.rangeValueIndicatorShape ?? _defaultValueIndicatorShape,
showValueIndicator: sliderTheme.showValueIndicator ?? _defaultShowValueIndicator, showValueIndicator: sliderTheme.showValueIndicator ?? _defaultShowValueIndicator,
valueIndicatorTextStyle: sliderTheme.valueIndicatorTextStyle ?? theme.textTheme.body2.copyWith( valueIndicatorTextStyle: sliderTheme.valueIndicatorTextStyle ?? theme.textTheme.bodyText1.copyWith(
color: theme.colorScheme.onPrimary, color: theme.colorScheme.onPrimary,
), ),
minThumbSeparation: sliderTheme.minThumbSeparation ?? _defaultMinThumbSeparation, minThumbSeparation: sliderTheme.minThumbSeparation ?? _defaultMinThumbSeparation,

View File

@ -510,7 +510,7 @@ class _SearchPageState<T> extends State<_SearchPage<T>> {
title: TextField( title: TextField(
controller: widget.delegate._queryTextController, controller: widget.delegate._queryTextController,
focusNode: focusNode, focusNode: focusNode,
style: theme.textTheme.title, style: theme.textTheme.headline6,
textInputAction: widget.delegate.textInputAction, textInputAction: widget.delegate.textInputAction,
keyboardType: widget.delegate.keyboardType, keyboardType: widget.delegate.keyboardType,
onSubmitted: (String _) { onSubmitted: (String _) {

View File

@ -302,7 +302,7 @@ class Slider extends StatefulWidget {
/// as part of the value indicator shape. /// as part of the value indicator shape.
/// ///
/// The label is rendered using the active [ThemeData]'s /// The label is rendered using the active [ThemeData]'s
/// [ThemeData.textTheme.body2] text style, with the /// [ThemeData.textTheme.bodyText1] text style, with the
/// theme data's [ThemeData.colorScheme.onPrimaryColor]. The label's text style /// theme data's [ThemeData.colorScheme.onPrimaryColor]. The label's text style
/// can be overridden with [SliderThemeData.valueIndicatorTextStyle]. /// can be overridden with [SliderThemeData.valueIndicatorTextStyle].
/// ///
@ -543,7 +543,7 @@ class _SliderState extends State<Slider> with TickerProviderStateMixin {
overlayShape: sliderTheme.overlayShape ?? _defaultOverlayShape, overlayShape: sliderTheme.overlayShape ?? _defaultOverlayShape,
valueIndicatorShape: sliderTheme.valueIndicatorShape ?? _defaultValueIndicatorShape, valueIndicatorShape: sliderTheme.valueIndicatorShape ?? _defaultValueIndicatorShape,
showValueIndicator: sliderTheme.showValueIndicator ?? _defaultShowValueIndicator, showValueIndicator: sliderTheme.showValueIndicator ?? _defaultShowValueIndicator,
valueIndicatorTextStyle: sliderTheme.valueIndicatorTextStyle ?? theme.textTheme.body2.copyWith( valueIndicatorTextStyle: sliderTheme.valueIndicatorTextStyle ?? theme.textTheme.bodyText1.copyWith(
color: theme.colorScheme.onPrimary, color: theme.colorScheme.onPrimary,
), ),
); );

View File

@ -360,7 +360,7 @@ class _SnackBarState extends State<SnackBar> {
snackBarTheme: snackBarTheme, snackBarTheme: snackBarTheme,
); );
final TextStyle contentTextStyle = snackBarTheme.contentTextStyle ?? inverseTheme.textTheme.subhead; final TextStyle contentTextStyle = snackBarTheme.contentTextStyle ?? inverseTheme.textTheme.subtitle1;
final SnackBarBehavior snackBarBehavior = widget.behavior ?? snackBarTheme.behavior ?? SnackBarBehavior.fixed; final SnackBarBehavior snackBarBehavior = widget.behavior ?? snackBarTheme.behavior ?? SnackBarBehavior.fixed;
final bool isFloatingSnackBar = snackBarBehavior == SnackBarBehavior.floating; final bool isFloatingSnackBar = snackBarBehavior == SnackBarBehavior.floating;
final double snackBarPadding = isFloatingSnackBar ? 16.0 : 24.0; final double snackBarPadding = isFloatingSnackBar ? 16.0 : 24.0;

View File

@ -444,13 +444,13 @@ class _StepperState extends State<Stepper> with TickerProviderStateMixin {
case StepState.indexed: case StepState.indexed:
case StepState.editing: case StepState.editing:
case StepState.complete: case StepState.complete:
return textTheme.body2; return textTheme.bodyText1;
case StepState.disabled: case StepState.disabled:
return textTheme.body2.copyWith( return textTheme.bodyText1.copyWith(
color: _isDark() ? _kDisabledDark : _kDisabledLight color: _isDark() ? _kDisabledDark : _kDisabledLight
); );
case StepState.error: case StepState.error:
return textTheme.body2.copyWith( return textTheme.bodyText1.copyWith(
color: _isDark() ? _kErrorDark : _kErrorLight color: _isDark() ? _kErrorDark : _kErrorLight
); );
} }

View File

@ -171,12 +171,12 @@ class _TabStyle extends AnimatedWidget {
// the same value of inherit. Force that to be inherit=true here. // the same value of inherit. Force that to be inherit=true here.
final TextStyle defaultStyle = (labelStyle final TextStyle defaultStyle = (labelStyle
?? tabBarTheme.labelStyle ?? tabBarTheme.labelStyle
?? themeData.primaryTextTheme.body2 ?? themeData.primaryTextTheme.bodyText1
).copyWith(inherit: true); ).copyWith(inherit: true);
final TextStyle defaultUnselectedStyle = (unselectedLabelStyle final TextStyle defaultUnselectedStyle = (unselectedLabelStyle
?? tabBarTheme.unselectedLabelStyle ?? tabBarTheme.unselectedLabelStyle
?? labelStyle ?? labelStyle
?? themeData.primaryTextTheme.body2 ?? themeData.primaryTextTheme.bodyText1
).copyWith(inherit: true); ).copyWith(inherit: true);
final TextStyle textStyle = selected final TextStyle textStyle = selected
? TextStyle.lerp(defaultStyle, defaultUnselectedStyle, animation.value) ? TextStyle.lerp(defaultStyle, defaultUnselectedStyle, animation.value)
@ -184,7 +184,7 @@ class _TabStyle extends AnimatedWidget {
final Color selectedColor = labelColor final Color selectedColor = labelColor
?? tabBarTheme.labelColor ?? tabBarTheme.labelColor
?? themeData.primaryTextTheme.body2.color; ?? themeData.primaryTextTheme.bodyText1.color;
final Color unselectedColor = unselectedLabelColor final Color unselectedColor = unselectedLabelColor
?? tabBarTheme.unselectedLabelColor ?? tabBarTheme.unselectedLabelColor
?? selectedColor.withAlpha(0xB2); // 70% alpha ?? selectedColor.withAlpha(0xB2); // 70% alpha
@ -701,7 +701,7 @@ class TabBar extends StatefulWidget implements PreferredSizeWidget {
/// opacity unless [unselectedLabelColor] is non-null. /// opacity unless [unselectedLabelColor] is non-null.
/// ///
/// If this parameter is null, then the color of the [ThemeData.primaryTextTheme]'s /// If this parameter is null, then the color of the [ThemeData.primaryTextTheme]'s
/// body2 text color is used. /// bodyText1 text color is used.
final Color labelColor; final Color labelColor;
/// The color of unselected tab labels. /// The color of unselected tab labels.
@ -716,7 +716,7 @@ class TabBar extends StatefulWidget implements PreferredSizeWidget {
/// both selected and unselected label styles. /// both selected and unselected label styles.
/// ///
/// If this property is null, then the text style of the /// If this property is null, then the text style of the
/// [ThemeData.primaryTextTheme]'s body2 definition is used. /// [ThemeData.primaryTextTheme]'s bodyText1 definition is used.
final TextStyle labelStyle; final TextStyle labelStyle;
/// The padding added to each of the tab labels. /// The padding added to each of the tab labels.
@ -728,7 +728,7 @@ class TabBar extends StatefulWidget implements PreferredSizeWidget {
/// ///
/// If this property is null, then the [labelStyle] value is used. If [labelStyle] /// If this property is null, then the [labelStyle] value is used. If [labelStyle]
/// is null, then the text style of the [ThemeData.primaryTextTheme]'s /// is null, then the text style of the [ThemeData.primaryTextTheme]'s
/// body2 definition is used. /// bodyText1 definition is used.
final TextStyle unselectedLabelStyle; final TextStyle unselectedLabelStyle;
/// {@macro flutter.widgets.scrollable.dragStartBehavior} /// {@macro flutter.widgets.scrollable.dragStartBehavior}

View File

@ -439,7 +439,7 @@ class TextField extends StatefulWidget {
/// ///
/// This text style is also used as the base style for the [decoration]. /// This text style is also used as the base style for the [decoration].
/// ///
/// If null, defaults to the `subhead` text style from the current [Theme]. /// If null, defaults to the `subtitle1` text style from the current [Theme].
final TextStyle style; final TextStyle style;
/// {@macro flutter.widgets.editableText.strutStyle} /// {@macro flutter.widgets.editableText.strutStyle}
@ -929,7 +929,7 @@ class _TextFieldState extends State<TextField> implements TextSelectionGestureDe
); );
final ThemeData themeData = Theme.of(context); final ThemeData themeData = Theme.of(context);
final TextStyle style = themeData.textTheme.subhead.merge(widget.style); final TextStyle style = themeData.textTheme.subtitle1.merge(widget.style);
final Brightness keyboardAppearance = widget.keyboardAppearance ?? themeData.primaryColorBrightness; final Brightness keyboardAppearance = widget.keyboardAppearance ?? themeData.primaryColorBrightness;
final TextEditingController controller = _effectiveController; final TextEditingController controller = _effectiveController;
final FocusNode focusNode = _effectiveFocusNode; final FocusNode focusNode = _effectiveFocusNode;

View File

@ -7,15 +7,29 @@ import 'package:flutter/painting.dart';
import 'typography.dart'; import 'typography.dart';
// Eventually we'll get rid of the deprecated members, but for now, we have to use them
// in order to implement them.
// ignore_for_file: deprecated_member_use_from_same_package
/// Material design text theme. /// Material design text theme.
/// ///
/// Definitions for the various typographical styles found in material design /// Definitions for the various typographical styles found in Material Design
/// (e.g., button, caption). Rather than creating a [TextTheme] directly, /// (e.g., button, caption). Rather than creating a [TextTheme] directly,
/// you can obtain an instance as [Typography.black] or [Typography.white]. /// you can obtain an instance as [Typography.black] or [Typography.white].
/// ///
/// To obtain the current text theme, call [Theme.of] with the current /// To obtain the current text theme, call [Theme.of] with the current
/// [BuildContext] and read the [ThemeData.textTheme] property. /// [BuildContext] and read the [ThemeData.textTheme] property.
/// ///
/// The names of the TextTheme properties match this table from the
/// [Material Design spec](https://material.io/design/typography/the-type-system.html#type-scale)
/// with two exceptions: the styles called H1-H6 in the spec are
/// headline1-headline6 in the API, and body1,body2 are called
/// bodyText1 and bodyText2.
///
/// ![](https://storage.googleapis.com/spec-host-backup/mio-design%2Fassets%2F1W8kyGVruuG_O8psvyiOaCf1lLFIMzB-N%2Ftypesystem-typescale.png)
///
/// ## Migrating from the 2014 names
///
/// The Material Design typography scheme was significantly changed in the /// The Material Design typography scheme was significantly changed in the
/// current (2018) version of the specification /// current (2018) version of the specification
/// (https://material.io/design/typography). /// (https://material.io/design/typography).
@ -25,32 +39,33 @@ import 'typography.dart';
/// NAME SIZE WEIGHT SPACING /// NAME SIZE WEIGHT SPACING
/// headline1 96.0 light -1.5 /// headline1 96.0 light -1.5
/// headline2 60.0 light -0.5 /// headline2 60.0 light -0.5
/// headline3 48.0 normal 0.0 /// headline3 48.0 regular 0.0
/// headline4 34.0 normal 0.25 /// headline4 34.0 regular 0.25
/// headline5 24.0 normal 0.0 /// headline5 24.0 regular 0.0
/// headline6 20.0 medium 0.15 /// headline6 20.0 medium 0.15
/// subtitle1 16.0 normal 0.15 /// subtitle1 16.0 regular 0.15
/// subtitle2 14.0 medium 0.1 /// subtitle2 14.0 medium 0.1
/// body1 16.0 normal 0.5 /// body1 16.0 regular 0.5 (bodyText1)
/// body2 14.0 normal 0.25 /// body2 14.0 regular 0.25 (bodyText2)
/// button 14.0 medium 0.75 /// button 14.0 medium 1.25
/// caption 12.0 normal 0.4 /// caption 12.0 regular 0.4
/// overline 10.0 normal 1.5 /// overline 10.0 regular 1.5
///
/// ``` /// ```
/// Where "light" is `FontWeight.w300`, "normal" is `FontWeight.w400` and ///
/// ...where "light" is `FontWeight.w300`, "regular" is `FontWeight.w400` and
/// "medium" is `FontWeight.w500`. /// "medium" is `FontWeight.w500`.
/// ///
/// The [TextTheme] API is based on the original material (2014) /// The [TextTheme] API was originally based on the original material (2014)
/// design spec, which used different text style names. For backwards /// design spec, which used different text style names. For backwards
/// compatibility's sake, this API continues to use the original /// compatibility's sake, this API continues to expose the old names. The table
/// names. The table below should help with understanding the API in /// below should help with understanding the mapping of the API's old names and
/// terms of the 2018 material spec. /// the new names (those in terms of the 2018 material specification).
/// ///
/// Each of the [TextTheme] text styles corresponds to one of the /// Each of the [TextTheme] text styles corresponds to one of the
/// styles from 2018 spec. By default, the font sizes, font weights /// styles from 2018 spec. By default, the font sizes, font weights
/// and letter spacings have not changed from their original, /// and letter spacings have not changed from their original,
/// 2014, values. /// 2014, values.
///
/// ``` /// ```
/// NAME SIZE WEIGHT SPACING 2018 NAME /// NAME SIZE WEIGHT SPACING 2018 NAME
/// display4 112.0 thin 0.0 headline1 /// display4 112.0 thin 0.0 headline1
@ -60,8 +75,8 @@ import 'typography.dart';
/// headline 24.0 normal 0.0 headline5 /// headline 24.0 normal 0.0 headline5
/// title 20.0 medium 0.0 headline6 /// title 20.0 medium 0.0 headline6
/// subhead 16.0 normal 0.0 subtitle1 /// subhead 16.0 normal 0.0 subtitle1
/// body2 14.0 medium 0.0 body1 /// body2 14.0 medium 0.0 body1 (bodyText1)
/// body1 14.0 normal 0.0 body2 /// body1 14.0 normal 0.0 body2 (bodyText2)
/// caption 12.0 normal 0.0 caption /// caption 12.0 normal 0.0 caption
/// button 14.0 medium 0.0 button /// button 14.0 medium 0.0 button
/// subtitle 14.0 medium 0.0 subtitle2 /// subtitle 14.0 medium 0.0 subtitle2
@ -72,21 +87,14 @@ import 'typography.dart';
/// "medium" is `FontWeight.w500`. Letter spacing for all of the original /// "medium" is `FontWeight.w500`. Letter spacing for all of the original
/// text styles was 0.0. /// text styles was 0.0.
/// ///
/// The old names are deprecated in this API.
///
/// Since the names `body1` and `body2` are used in both specifications but with
/// different meanings, the API uses the terms `bodyText1` and `bodyText2` for
/// the new API.
///
/// To configure a [Theme] for the new sizes, weights, and letter spacings, /// To configure a [Theme] for the new sizes, weights, and letter spacings,
/// initialize its [ThemeData.typography] value with a [Typography] that /// initialize its [ThemeData.typography] value using [Typography.material2018].
/// object that specifies the 2018 versions of the geometry themes:
/// [Typography.englishLike2018], [Typography.dense2018],
/// and [Typography.tall2018].
///
/// The following image [from the material design
/// specification](https://material.io/go/design-typography#typography-styles)
/// shows the recommended styles for each of the properties of a [TextTheme].
/// This image uses the `Roboto` font, which is the font used on Android. On
/// iOS, the [San Francisco
/// font](https://developer.apple.com/ios/human-interface-guidelines/visual-design/typography/)
/// is automatically used instead.
///
/// ![To see the image, visit the typography site referenced below.](https://storage.googleapis.com/material-design/publish/material_v_11/assets/0Bzhp5Z4wHba3alhXZ2pPWGk3Zjg/style_typography_styles_scale.png)
/// ///
/// See also: /// See also:
/// ///
@ -107,53 +115,120 @@ class TextTheme extends Diagnosticable {
/// If you do decide to create your own text theme, consider using one of /// If you do decide to create your own text theme, consider using one of
/// those predefined themes as a starting point for [copyWith] or [apply]. /// those predefined themes as a starting point for [copyWith] or [apply].
const TextTheme({ const TextTheme({
this.display4, TextStyle headline1,
this.display3, TextStyle headline2,
this.display2, TextStyle headline3,
this.display1, TextStyle headline4,
this.headline, TextStyle headline5,
this.title, TextStyle headline6,
this.subhead, TextStyle subtitle1,
this.body2, TextStyle subtitle2,
this.body1, TextStyle bodyText1,
TextStyle bodyText2,
this.caption, this.caption,
this.button, this.button,
this.subtitle,
this.overline, this.overline,
}); @Deprecated(
'This is the term used in the 2014 version of material design. The modern term is headline1. '
'This feature was deprecated after v1.13.8.'
)
TextStyle display4,
@Deprecated(
'This is the term used in the 2014 version of material design. The modern term is headline2. '
'This feature was deprecated after v1.13.8.'
)
TextStyle display3,
@Deprecated(
'This is the term used in the 2014 version of material design. The modern term is headline3. '
'This feature was deprecated after v1.13.8.'
)
TextStyle display2,
@Deprecated(
'This is the term used in the 2014 version of material design. The modern term is headline4. '
'This feature was deprecated after v1.13.8.'
)
TextStyle display1,
@Deprecated(
'This is the term used in the 2014 version of material design. The modern term is headline5. '
'This feature was deprecated after v1.13.8.'
)
TextStyle headline,
@Deprecated(
'This is the term used in the 2014 version of material design. The modern term is headline6. '
'This feature was deprecated after v1.13.8.'
)
TextStyle title,
@Deprecated(
'This is the term used in the 2014 version of material design. The modern term is subtitle1. '
'This feature was deprecated after v1.13.8.'
)
TextStyle subhead,
@Deprecated(
'This is the term used in the 2014 version of material design. The modern term is subtitle2. '
'This feature was deprecated after v1.13.8.'
)
TextStyle subtitle,
@Deprecated(
'This is the term used in the 2014 version of material design. The modern term is bodyText1. '
'This feature was deprecated after v1.13.8.'
)
TextStyle body2,
@Deprecated(
'This is the term used in the 2014 version of material design. The modern term is bodyText2. '
'This feature was deprecated after v1.13.8.'
)
TextStyle body1,
}) : assert(
(headline1 == null && headline2 == null && headline3 == null && headline4 == null && headline5 == null && headline6 == null &&
subtitle1 == null && subtitle2 == null &&
bodyText1 == null && bodyText2 == null) ||
(display4 == null && display3 == null && display2 == null && display1 == null && headline == null && title == null &&
subhead == null && subtitle == null &&
body2 == null && body1 == null), 'Cannot mix 2014 and 2018 terms in call to TextTheme() constructor.'),
headline1 = headline1 ?? display4,
headline2 = headline2 ?? display3,
headline3 = headline3 ?? display2,
headline4 = headline4 ?? display1,
headline5 = headline5 ?? headline,
headline6 = headline6 ?? title,
subtitle1 = subtitle1 ?? subhead,
subtitle2 = subtitle2 ?? subtitle,
bodyText1 = bodyText1 ?? body2,
bodyText2 = bodyText2 ?? body1;
/// Extremely large text. /// Extremely large text.
/// final TextStyle headline1;
/// The font size is 112 pixels.
final TextStyle display4;
/// Very, very large text. /// Very, very large text.
/// ///
/// Used for the date in the dialog shown by [showDatePicker]. /// Used for the date in the dialog shown by [showDatePicker].
final TextStyle display3; final TextStyle headline2;
/// Very large text. /// Very large text.
final TextStyle display2; final TextStyle headline3;
/// Large text. /// Large text.
final TextStyle display1; final TextStyle headline4;
/// Used for large text in dialogs (e.g., the month and year in the dialog /// Used for large text in dialogs (e.g., the month and year in the dialog
/// shown by [showDatePicker]). /// shown by [showDatePicker]).
final TextStyle headline; final TextStyle headline5;
/// Used for the primary text in app bars and dialogs (e.g., [AppBar.title] /// Used for the primary text in app bars and dialogs (e.g., [AppBar.title]
/// and [AlertDialog.title]). /// and [AlertDialog.title]).
final TextStyle title; final TextStyle headline6;
/// Used for the primary text in lists (e.g., [ListTile.title]). /// Used for the primary text in lists (e.g., [ListTile.title]).
final TextStyle subhead; final TextStyle subtitle1;
/// Used for emphasizing text that would otherwise be [body1]. /// For medium emphasis text that's a little smaller than [subtitle1].
final TextStyle body2; final TextStyle subtitle2;
/// Used for emphasizing text that would otherwise be [bodyText2].
final TextStyle bodyText1;
/// Used for the default text style for [Material]. /// Used for the default text style for [Material].
final TextStyle body1; final TextStyle bodyText2;
/// Used for auxiliary text associated with images. /// Used for auxiliary text associated with images.
final TextStyle caption; final TextStyle caption;
@ -161,14 +236,114 @@ class TextTheme extends Diagnosticable {
/// Used for text on [RaisedButton] and [FlatButton]. /// Used for text on [RaisedButton] and [FlatButton].
final TextStyle button; final TextStyle button;
/// For medium emphasis text that's a little smaller than [subhead]. /// The smallest style.
final TextStyle subtitle;
/// The smallest style,
/// ///
/// Typically used for captions or to introduce a (larger) headline. /// Typically used for captions or to introduce a (larger) headline.
final TextStyle overline; final TextStyle overline;
/// Extremely large text.
///
/// This was the name used in the material design 2014 specification. The new
/// specification calls this [headline1].
@Deprecated(
'This is the term used in the 2014 version of material design. The modern term is headline1. '
'This feature was deprecated after v1.13.8.'
)
TextStyle get display4 => headline1;
/// Very, very large text.
///
/// This was the name used in the material design 2014 specification. The new
/// specification calls this [headline2].
@Deprecated(
'This is the term used in the 2014 version of material design. The modern term is headline2. '
'This feature was deprecated after v1.13.8.'
)
TextStyle get display3 => headline2;
/// Very large text.
///
/// This was the name used in the material design 2014 specification. The new
/// specification calls this [headline3].
@Deprecated(
'This is the term used in the 2014 version of material design. The modern term is headline3. '
'This feature was deprecated after v1.13.8.'
)
TextStyle get display2 => headline3;
/// Large text.
///
/// This was the name used in the material design 2014 specification. The new
/// specification calls this [headline4].
@Deprecated(
'This is the term used in the 2014 version of material design. The modern term is headline4. '
'This feature was deprecated after v1.13.8.'
)
TextStyle get display1 => headline4;
/// Used for large text in dialogs.
///
/// This was the name used in the material design 2014 specification. The new
/// specification calls this [headline5].
@Deprecated(
'This is the term used in the 2014 version of material design. The modern term is headline5. '
'This feature was deprecated after v1.13.8.'
)
TextStyle get headline => headline5;
/// Used for the primary text in app bars and dialogs.
///
/// This was the name used in the material design 2014 specification. The new
/// specification calls this [headline6].
@Deprecated(
'This is the term used in the 2014 version of material design. The modern term is headline6. '
'This feature was deprecated after v1.13.8.'
)
TextStyle get title => headline6;
/// Used for the primary text in lists (e.g., [ListTile.title]).
///
/// This was the name used in the material design 2014 specification. The new
/// specification calls this [subtitle1].
@Deprecated(
'This is the term used in the 2014 version of material design. The modern term is subtitle1. '
'This feature was deprecated after v1.13.8.'
)
TextStyle get subhead => subtitle1;
/// For medium emphasis text that's a little smaller than [subhead].
///
/// This was the name used in the material design 2014 specification. The new
/// specification calls this [subtitle2].
@Deprecated(
'This is the term used in the 2014 version of material design. The modern term is subtitle2. '
'This feature was deprecated after v1.13.8.'
)
TextStyle get subtitle => subtitle2;
/// Used for emphasizing text that would otherwise be [body1].
///
/// This was the name used in the material design 2014 specification. The new
/// specification calls this `body1`, and it is exposed in this API as
/// [textBody1].
@Deprecated(
'This is the term used in the 2014 version of material design. The modern term is bodyText1. '
'This feature was deprecated after v1.13.8.'
)
TextStyle get body2 => bodyText1;
/// Used for the default text style for [Material].
///
/// This was the name used in the material design 2014 specification. The new
/// specification calls this `body2`, and it is exposed in this API as
/// [textBody2].
@Deprecated(
'This is the term used in the 2014 version of material design. The modern term is bodyText1. '
'This feature was deprecated after v1.13.8.'
)
TextStyle get body1 => bodyText2;
/// Creates a copy of this text theme but with the given fields replaced with /// Creates a copy of this text theme but with the given fields replaced with
/// the new values. /// the new values.
/// ///
@ -193,7 +368,7 @@ class TextTheme extends Diagnosticable {
/// return Theme( /// return Theme(
/// data: theme.copyWith( /// data: theme.copyWith(
/// textTheme: theme.textTheme.copyWith( /// textTheme: theme.textTheme.copyWith(
/// title: theme.textTheme.title.copyWith( /// headline6: theme.textTheme.headline6.copyWith(
/// color: titleColor, /// color: titleColor,
/// ), /// ),
/// ), /// ),
@ -210,33 +385,90 @@ class TextTheme extends Diagnosticable {
/// * [merge] is used instead of [copyWith] when you want to merge all /// * [merge] is used instead of [copyWith] when you want to merge all
/// of the fields of a TextTheme instead of individual fields. /// of the fields of a TextTheme instead of individual fields.
TextTheme copyWith({ TextTheme copyWith({
TextStyle display4, TextStyle headline1,
TextStyle display3, TextStyle headline2,
TextStyle display2, TextStyle headline3,
TextStyle display1, TextStyle headline4,
TextStyle headline, TextStyle headline5,
TextStyle title, TextStyle headline6,
TextStyle subhead, TextStyle subtitle1,
TextStyle body2, TextStyle subtitle2,
TextStyle body1, TextStyle bodyText1,
TextStyle bodyText2,
TextStyle caption, TextStyle caption,
TextStyle button, TextStyle button,
TextStyle subtitle,
TextStyle overline, TextStyle overline,
@Deprecated(
'This is the term used in the 2014 version of material design. The modern term is headline1. '
'This feature was deprecated after v1.13.8.'
)
TextStyle display4,
@Deprecated(
'This is the term used in the 2014 version of material design. The modern term is headline2. '
'This feature was deprecated after v1.13.8.'
)
TextStyle display3,
@Deprecated(
'This is the term used in the 2014 version of material design. The modern term is headline3. '
'This feature was deprecated after v1.13.8.'
)
TextStyle display2,
@Deprecated(
'This is the term used in the 2014 version of material design. The modern term is headline4. '
'This feature was deprecated after v1.13.8.'
)
TextStyle display1,
@Deprecated(
'This is the term used in the 2014 version of material design. The modern term is headline5. '
'This feature was deprecated after v1.13.8.'
)
TextStyle headline,
@Deprecated(
'This is the term used in the 2014 version of material design. The modern term is headline6. '
'This feature was deprecated after v1.13.8.'
)
TextStyle title,
@Deprecated(
'This is the term used in the 2014 version of material design. The modern term is subtitle1. '
'This feature was deprecated after v1.13.8.'
)
TextStyle subhead,
@Deprecated(
'This is the term used in the 2014 version of material design. The modern term is subtitle2. '
'This feature was deprecated after v1.13.8.'
)
TextStyle subtitle,
@Deprecated(
'This is the term used in the 2014 version of material design. The modern term is bodyText1. '
'This feature was deprecated after v1.13.8.'
)
TextStyle body2,
@Deprecated(
'This is the term used in the 2014 version of material design. The modern term is bodyText2. '
'This feature was deprecated after v1.13.8.'
)
TextStyle body1,
}) { }) {
assert(
(headline1 == null && headline2 == null && headline3 == null && headline4 == null && headline5 == null && headline6 == null &&
subtitle1 == null && subtitle2 == null &&
bodyText1 == null && bodyText2 == null) ||
(display4 == null && display3 == null && display2 == null && display1 == null && headline == null && title == null &&
subhead == null && subtitle == null &&
body2 == null && body1 == null), 'Cannot mix 2014 and 2018 terms in call to TextTheme.copyWith().');
return TextTheme( return TextTheme(
display4: display4 ?? this.display4, headline1: headline1 ?? display4 ?? this.headline1,
display3: display3 ?? this.display3, headline2: headline2 ?? display3 ?? this.headline2,
display2: display2 ?? this.display2, headline3: headline3 ?? display2 ?? this.headline3,
display1: display1 ?? this.display1, headline4: headline4 ?? display1 ?? this.headline4,
headline: headline ?? this.headline, headline5: headline5 ?? headline ?? this.headline5,
title: title ?? this.title, headline6: headline6 ?? title ?? this.headline6,
subhead: subhead ?? this.subhead, subtitle1: subtitle1 ?? subhead ?? this.subtitle1,
body2: body2 ?? this.body2, subtitle2: subtitle2 ?? subtitle ?? this.subtitle2,
body1: body1 ?? this.body1, bodyText1: bodyText1 ?? body2 ?? this.bodyText1,
bodyText2: bodyText2 ?? body1 ?? this.bodyText2,
caption: caption ?? this.caption, caption: caption ?? this.caption,
button: button ?? this.button, button: button ?? this.button,
subtitle: subtitle ?? this.subtitle,
overline: overline ?? this.overline, overline: overline ?? this.overline,
); );
} }
@ -279,7 +511,7 @@ class TextTheme extends Diagnosticable {
/// // set the title, but everything else would be null. This isn't very /// // set the title, but everything else would be null. This isn't very
/// // useful, so merge it with the existing theme to keep all of the /// // useful, so merge it with the existing theme to keep all of the
/// // preexisting definitions for the other styles. /// // preexisting definitions for the other styles.
/// TextTheme partialTheme = TextTheme(title: TextStyle(color: titleColor)); /// TextTheme partialTheme = TextTheme(headline6: TextStyle(color: titleColor));
/// theme = theme.copyWith(textTheme: theme.textTheme.merge(partialTheme)); /// theme = theme.copyWith(textTheme: theme.textTheme.merge(partialTheme));
/// return Theme(data: theme, child: child); /// return Theme(data: theme, child: child);
/// } /// }
@ -296,18 +528,18 @@ class TextTheme extends Diagnosticable {
if (other == null) if (other == null)
return this; return this;
return copyWith( return copyWith(
display4: display4?.merge(other.display4) ?? other.display4, headline1: headline1?.merge(other.headline1) ?? other.headline1,
display3: display3?.merge(other.display3) ?? other.display3, headline2: headline2?.merge(other.headline2) ?? other.headline2,
display2: display2?.merge(other.display2) ?? other.display2, headline3: headline3?.merge(other.headline3) ?? other.headline3,
display1: display1?.merge(other.display1) ?? other.display1, headline4: headline4?.merge(other.headline4) ?? other.headline4,
headline: headline?.merge(other.headline) ?? other.headline, headline5: headline5?.merge(other.headline5) ?? other.headline5,
title: title?.merge(other.title) ?? other.title, headline6: headline6?.merge(other.headline6) ?? other.headline6,
subhead: subhead?.merge(other.subhead) ?? other.subhead, subtitle1: subtitle1?.merge(other.subtitle1) ?? other.subtitle1,
body2: body2?.merge(other.body2) ?? other.body2, subtitle2: subtitle2?.merge(other.subtitle2) ?? other.subtitle2,
body1: body1?.merge(other.body1) ?? other.body1, bodyText1: bodyText1?.merge(other.bodyText1) ?? other.bodyText1,
bodyText2: bodyText2?.merge(other.bodyText2) ?? other.bodyText2,
caption: caption?.merge(other.caption) ?? other.caption, caption: caption?.merge(other.caption) ?? other.caption,
button: button?.merge(other.button) ?? other.button, button: button?.merge(other.button) ?? other.button,
subtitle: subtitle?.merge(other.subtitle) ?? other.subtitle,
overline: overline?.merge(other.overline) ?? other.overline, overline: overline?.merge(other.overline) ?? other.overline,
); );
} }
@ -315,8 +547,8 @@ class TextTheme extends Diagnosticable {
/// Creates a copy of this text theme but with the given field replaced in /// Creates a copy of this text theme but with the given field replaced in
/// each of the individual text styles. /// each of the individual text styles.
/// ///
/// The `displayColor` is applied to [display4], [display3], [display2], /// The `displayColor` is applied to [headline4], [headline3], [headline2],
/// [display1], and [caption]. The `bodyColor` is applied to the remaining /// [headline1], and [caption]. The `bodyColor` is applied to the remaining
/// text styles. /// text styles.
/// ///
/// Consider using [Typography.black] or [Typography.white], which implement /// Consider using [Typography.black] or [Typography.white], which implement
@ -333,7 +565,7 @@ class TextTheme extends Diagnosticable {
TextDecorationStyle decorationStyle, TextDecorationStyle decorationStyle,
}) { }) {
return TextTheme( return TextTheme(
display4: display4?.apply( headline1: headline1?.apply(
color: displayColor, color: displayColor,
decoration: decoration, decoration: decoration,
decorationColor: decorationColor, decorationColor: decorationColor,
@ -342,7 +574,7 @@ class TextTheme extends Diagnosticable {
fontSizeFactor: fontSizeFactor, fontSizeFactor: fontSizeFactor,
fontSizeDelta: fontSizeDelta, fontSizeDelta: fontSizeDelta,
), ),
display3: display3?.apply( headline2: headline2?.apply(
color: displayColor, color: displayColor,
decoration: decoration, decoration: decoration,
decorationColor: decorationColor, decorationColor: decorationColor,
@ -351,7 +583,7 @@ class TextTheme extends Diagnosticable {
fontSizeFactor: fontSizeFactor, fontSizeFactor: fontSizeFactor,
fontSizeDelta: fontSizeDelta, fontSizeDelta: fontSizeDelta,
), ),
display2: display2?.apply( headline3: headline3?.apply(
color: displayColor, color: displayColor,
decoration: decoration, decoration: decoration,
decorationColor: decorationColor, decorationColor: decorationColor,
@ -360,7 +592,7 @@ class TextTheme extends Diagnosticable {
fontSizeFactor: fontSizeFactor, fontSizeFactor: fontSizeFactor,
fontSizeDelta: fontSizeDelta, fontSizeDelta: fontSizeDelta,
), ),
display1: display1?.apply( headline4: headline4?.apply(
color: displayColor, color: displayColor,
decoration: decoration, decoration: decoration,
decorationColor: decorationColor, decorationColor: decorationColor,
@ -369,7 +601,7 @@ class TextTheme extends Diagnosticable {
fontSizeFactor: fontSizeFactor, fontSizeFactor: fontSizeFactor,
fontSizeDelta: fontSizeDelta, fontSizeDelta: fontSizeDelta,
), ),
headline: headline?.apply( headline5: headline5?.apply(
color: bodyColor, color: bodyColor,
decoration: decoration, decoration: decoration,
decorationColor: decorationColor, decorationColor: decorationColor,
@ -378,7 +610,7 @@ class TextTheme extends Diagnosticable {
fontSizeFactor: fontSizeFactor, fontSizeFactor: fontSizeFactor,
fontSizeDelta: fontSizeDelta, fontSizeDelta: fontSizeDelta,
), ),
title: title?.apply( headline6: headline6?.apply(
color: bodyColor, color: bodyColor,
decoration: decoration, decoration: decoration,
decorationColor: decorationColor, decorationColor: decorationColor,
@ -387,7 +619,7 @@ class TextTheme extends Diagnosticable {
fontSizeFactor: fontSizeFactor, fontSizeFactor: fontSizeFactor,
fontSizeDelta: fontSizeDelta, fontSizeDelta: fontSizeDelta,
), ),
subhead: subhead?.apply( subtitle1: subtitle1?.apply(
color: bodyColor, color: bodyColor,
decoration: decoration, decoration: decoration,
decorationColor: decorationColor, decorationColor: decorationColor,
@ -396,7 +628,7 @@ class TextTheme extends Diagnosticable {
fontSizeFactor: fontSizeFactor, fontSizeFactor: fontSizeFactor,
fontSizeDelta: fontSizeDelta, fontSizeDelta: fontSizeDelta,
), ),
body2: body2?.apply( subtitle2: subtitle2?.apply(
color: bodyColor, color: bodyColor,
decoration: decoration, decoration: decoration,
decorationColor: decorationColor, decorationColor: decorationColor,
@ -405,7 +637,16 @@ class TextTheme extends Diagnosticable {
fontSizeFactor: fontSizeFactor, fontSizeFactor: fontSizeFactor,
fontSizeDelta: fontSizeDelta, fontSizeDelta: fontSizeDelta,
), ),
body1: body1?.apply( bodyText1: bodyText1?.apply(
color: bodyColor,
decoration: decoration,
decorationColor: decorationColor,
decorationStyle: decorationStyle,
fontFamily: fontFamily,
fontSizeFactor: fontSizeFactor,
fontSizeDelta: fontSizeDelta,
),
bodyText2: bodyText2?.apply(
color: bodyColor, color: bodyColor,
decoration: decoration, decoration: decoration,
decorationColor: decorationColor, decorationColor: decorationColor,
@ -432,15 +673,6 @@ class TextTheme extends Diagnosticable {
fontSizeFactor: fontSizeFactor, fontSizeFactor: fontSizeFactor,
fontSizeDelta: fontSizeDelta, fontSizeDelta: fontSizeDelta,
), ),
subtitle: subtitle?.apply(
color: bodyColor,
decoration: decoration,
decorationColor: decorationColor,
decorationStyle: decorationStyle,
fontFamily: fontFamily,
fontSizeFactor: fontSizeFactor,
fontSizeDelta: fontSizeDelta,
),
overline: overline?.apply( overline: overline?.apply(
color: bodyColor, color: bodyColor,
decoration: decoration, decoration: decoration,
@ -459,18 +691,18 @@ class TextTheme extends Diagnosticable {
static TextTheme lerp(TextTheme a, TextTheme b, double t) { static TextTheme lerp(TextTheme a, TextTheme b, double t) {
assert(t != null); assert(t != null);
return TextTheme( return TextTheme(
display4: TextStyle.lerp(a?.display4, b?.display4, t), headline1: TextStyle.lerp(a?.headline1, b?.headline1, t),
display3: TextStyle.lerp(a?.display3, b?.display3, t), headline2: TextStyle.lerp(a?.headline2, b?.headline2, t),
display2: TextStyle.lerp(a?.display2, b?.display2, t), headline3: TextStyle.lerp(a?.headline3, b?.headline3, t),
display1: TextStyle.lerp(a?.display1, b?.display1, t), headline4: TextStyle.lerp(a?.headline4, b?.headline4, t),
headline: TextStyle.lerp(a?.headline, b?.headline, t), headline5: TextStyle.lerp(a?.headline5, b?.headline5, t),
title: TextStyle.lerp(a?.title, b?.title, t), headline6: TextStyle.lerp(a?.headline6, b?.headline6, t),
subhead: TextStyle.lerp(a?.subhead, b?.subhead, t), subtitle1: TextStyle.lerp(a?.subtitle1, b?.subtitle1, t),
body2: TextStyle.lerp(a?.body2, b?.body2, t), subtitle2: TextStyle.lerp(a?.subtitle2, b?.subtitle2, t),
body1: TextStyle.lerp(a?.body1, b?.body1, t), bodyText1: TextStyle.lerp(a?.bodyText1, b?.bodyText1, t),
bodyText2: TextStyle.lerp(a?.bodyText2, b?.bodyText2, t),
caption: TextStyle.lerp(a?.caption, b?.caption, t), caption: TextStyle.lerp(a?.caption, b?.caption, t),
button: TextStyle.lerp(a?.button, b?.button, t), button: TextStyle.lerp(a?.button, b?.button, t),
subtitle: TextStyle.lerp(a?.subtitle, b?.subtitle, t),
overline: TextStyle.lerp(a?.overline, b?.overline, t), overline: TextStyle.lerp(a?.overline, b?.overline, t),
); );
} }
@ -482,37 +714,37 @@ class TextTheme extends Diagnosticable {
if (other.runtimeType != runtimeType) if (other.runtimeType != runtimeType)
return false; return false;
return other is TextTheme return other is TextTheme
&& other.display4 == display4 && headline1 == other.headline1
&& other.display3 == display3 && headline2 == other.headline2
&& other.display2 == display2 && headline3 == other.headline3
&& other.display1 == display1 && headline4 == other.headline4
&& other.headline == headline && headline5 == other.headline5
&& other.title == title && headline6 == other.headline6
&& other.subhead == subhead && subtitle1 == other.subtitle1
&& other.body2 == body2 && subtitle2 == other.subtitle2
&& other.body1 == body1 && bodyText1 == other.bodyText1
&& other.caption == caption && bodyText2 == other.bodyText2
&& other.button == button && caption == other.caption
&& other.subtitle == subtitle && button == other.button
&& other.overline == overline; && overline == other.overline;
} }
@override @override
int get hashCode { int get hashCode {
// The hashValues() function supports up to 20 arguments. // The hashValues() function supports up to 20 arguments.
return hashValues( return hashValues(
display4, headline1,
display3, headline2,
display2, headline3,
display1, headline4,
headline, headline5,
title, headline6,
subhead, subtitle1,
body2, subtitle2,
body1, bodyText1,
bodyText2,
caption, caption,
button, button,
subtitle,
overline, overline,
); );
} }
@ -520,19 +752,19 @@ class TextTheme extends Diagnosticable {
@override @override
void debugFillProperties(DiagnosticPropertiesBuilder properties) { void debugFillProperties(DiagnosticPropertiesBuilder properties) {
super.debugFillProperties(properties); super.debugFillProperties(properties);
final TextTheme defaultTheme = Typography(platform: defaultTargetPlatform).black; final TextTheme defaultTheme = Typography.material2018(platform: defaultTargetPlatform).black;
properties.add(DiagnosticsProperty<TextStyle>('display4', display4, defaultValue: defaultTheme.display4)); properties.add(DiagnosticsProperty<TextStyle>('headline1', headline1, defaultValue: defaultTheme.headline1));
properties.add(DiagnosticsProperty<TextStyle>('display3', display3, defaultValue: defaultTheme.display3)); properties.add(DiagnosticsProperty<TextStyle>('headline2', headline2, defaultValue: defaultTheme.headline2));
properties.add(DiagnosticsProperty<TextStyle>('display2', display2, defaultValue: defaultTheme.display2)); properties.add(DiagnosticsProperty<TextStyle>('headline3', headline3, defaultValue: defaultTheme.headline3));
properties.add(DiagnosticsProperty<TextStyle>('display1', display1, defaultValue: defaultTheme.display1)); properties.add(DiagnosticsProperty<TextStyle>('headline4', headline4, defaultValue: defaultTheme.headline4));
properties.add(DiagnosticsProperty<TextStyle>('headline', headline, defaultValue: defaultTheme.headline)); properties.add(DiagnosticsProperty<TextStyle>('headline5', headline5, defaultValue: defaultTheme.headline5));
properties.add(DiagnosticsProperty<TextStyle>('title', title, defaultValue: defaultTheme.title)); properties.add(DiagnosticsProperty<TextStyle>('headline6', headline6, defaultValue: defaultTheme.headline6));
properties.add(DiagnosticsProperty<TextStyle>('subhead', subhead, defaultValue: defaultTheme.subhead)); properties.add(DiagnosticsProperty<TextStyle>('subtitle1', subtitle1, defaultValue: defaultTheme.subtitle1));
properties.add(DiagnosticsProperty<TextStyle>('body2', body2, defaultValue: defaultTheme.body2)); properties.add(DiagnosticsProperty<TextStyle>('subtitle2', subtitle2, defaultValue: defaultTheme.subtitle2));
properties.add(DiagnosticsProperty<TextStyle>('body1', body1, defaultValue: defaultTheme.body1)); properties.add(DiagnosticsProperty<TextStyle>('bodyText1', bodyText1, defaultValue: defaultTheme.bodyText1));
properties.add(DiagnosticsProperty<TextStyle>('bodyText2', bodyText2, defaultValue: defaultTheme.bodyText2));
properties.add(DiagnosticsProperty<TextStyle>('caption', caption, defaultValue: defaultTheme.caption)); properties.add(DiagnosticsProperty<TextStyle>('caption', caption, defaultValue: defaultTheme.caption));
properties.add(DiagnosticsProperty<TextStyle>('button', button, defaultValue: defaultTheme.button)); properties.add(DiagnosticsProperty<TextStyle>('button', button, defaultValue: defaultTheme.button));
properties.add(DiagnosticsProperty<TextStyle>('subtitle)', subtitle, defaultValue: defaultTheme.subtitle));
properties.add(DiagnosticsProperty<TextStyle>('overline', overline, defaultValue: defaultTheme.overline)); properties.add(DiagnosticsProperty<TextStyle>('overline', overline, defaultValue: defaultTheme.overline));
} }
} }

View File

@ -92,7 +92,7 @@ class Theme extends StatelessWidget {
/// Widget build(BuildContext context) { /// Widget build(BuildContext context) {
/// return Text( /// return Text(
/// 'Example', /// 'Example',
/// style: Theme.of(context).textTheme.title, /// style: Theme.of(context).textTheme.headline6,
/// ); /// );
/// } /// }
/// ``` /// ```
@ -116,7 +116,7 @@ class Theme extends StatelessWidget {
/// return Center( /// return Center(
/// child: Text( /// child: Text(
/// 'Example', /// 'Example',
/// style: Theme.of(context).textTheme.title, /// style: Theme.of(context).textTheme.headline6,
/// ), /// ),
/// ); /// );
/// }, /// },

View File

@ -133,7 +133,7 @@ enum MaterialTapTargetSize {
/// This sample creates a [MaterialApp] widget that stores `ThemeData` and /// This sample creates a [MaterialApp] widget that stores `ThemeData` and
/// passes the `ThemeData` to descendant widgets. The [AppBar] widget uses the /// passes the `ThemeData` to descendant widgets. The [AppBar] widget uses the
/// [primaryColor] to create a blue background. The [Text] widget uses the /// [primaryColor] to create a blue background. The [Text] widget uses the
/// [TextTheme.body1] to create purple text. The [FloatingActionButton] widget /// [TextTheme.bodyText2] to create purple text. The [FloatingActionButton] widget
/// uses the [accentColor] to create a green background. /// uses the [accentColor] to create a green background.
/// ///
/// ![](https://flutter.github.io/assets-for-api-docs/assets/material/material_app_theme_data.png) /// ![](https://flutter.github.io/assets-for-api-docs/assets/material/material_app_theme_data.png)
@ -143,7 +143,7 @@ enum MaterialTapTargetSize {
/// theme: ThemeData( /// theme: ThemeData(
/// primaryColor: Colors.blue, /// primaryColor: Colors.blue,
/// accentColor: Colors.green, /// accentColor: Colors.green,
/// textTheme: TextTheme(body1: TextStyle(color: Colors.purple)), /// textTheme: TextTheme(bodyText2: TextStyle(color: Colors.purple)),
/// ), /// ),
/// home: Scaffold( /// home: Scaffold(
/// appBar: AppBar( /// appBar: AppBar(
@ -316,7 +316,7 @@ class ThemeData extends Diagnosticable {
accentIconTheme ??= accentIsDark ? const IconThemeData(color: Colors.white) : const IconThemeData(color: Colors.black); accentIconTheme ??= accentIsDark ? const IconThemeData(color: Colors.white) : const IconThemeData(color: Colors.black);
iconTheme ??= isDark ? const IconThemeData(color: Colors.white) : const IconThemeData(color: Colors.black87); iconTheme ??= isDark ? const IconThemeData(color: Colors.white) : const IconThemeData(color: Colors.black87);
platform ??= defaultTargetPlatform; platform ??= defaultTargetPlatform;
typography ??= Typography(platform: platform); typography ??= Typography.material2014(platform: platform);
TextTheme defaultTextTheme = isDark ? typography.white : typography.black; TextTheme defaultTextTheme = isDark ? typography.white : typography.black;
TextTheme defaultPrimaryTextTheme = primaryIsDark ? typography.white : typography.black; TextTheme defaultPrimaryTextTheme = primaryIsDark ? typography.white : typography.black;
TextTheme defaultAccentTextTheme = accentIsDark ? typography.white : typography.black; TextTheme defaultAccentTextTheme = accentIsDark ? typography.white : typography.black;
@ -360,7 +360,7 @@ class ThemeData extends Diagnosticable {
chipTheme ??= ChipThemeData.fromDefaults( chipTheme ??= ChipThemeData.fromDefaults(
secondaryColor: primaryColor, secondaryColor: primaryColor,
brightness: brightness, brightness: brightness,
labelStyle: textTheme.body2, labelStyle: textTheme.bodyText1,
); );
dialogTheme ??= const DialogTheme(); dialogTheme ??= const DialogTheme();
floatingActionButtonTheme ??= const FloatingActionButtonThemeData(); floatingActionButtonTheme ??= const FloatingActionButtonThemeData();

View File

@ -239,10 +239,10 @@ class _DayPeriodControl extends StatelessWidget {
final Color activeColor = fragmentContext.activeColor; final Color activeColor = fragmentContext.activeColor;
final Color inactiveColor = fragmentContext.inactiveColor; final Color inactiveColor = fragmentContext.inactiveColor;
final bool amSelected = selectedTime.period == DayPeriod.am; final bool amSelected = selectedTime.period == DayPeriod.am;
final TextStyle amStyle = headerTextTheme.subhead.copyWith( final TextStyle amStyle = headerTextTheme.subtitle1.copyWith(
color: amSelected ? activeColor: inactiveColor color: amSelected ? activeColor: inactiveColor
); );
final TextStyle pmStyle = headerTextTheme.subhead.copyWith( final TextStyle pmStyle = headerTextTheme.subtitle1.copyWith(
color: !amSelected ? activeColor: inactiveColor color: !amSelected ? activeColor: inactiveColor
); );
final bool layoutPortrait = orientation == Orientation.portrait; final bool layoutPortrait = orientation == Orientation.portrait;
@ -771,9 +771,9 @@ class _TimePickerHeader extends StatelessWidget {
assert(orientation != null); assert(orientation != null);
switch (orientation) { switch (orientation) {
case Orientation.portrait: case Orientation.portrait:
return headerTextTheme.display3.copyWith(fontSize: 60.0); return headerTextTheme.headline2.copyWith(fontSize: 60.0);
case Orientation.landscape: case Orientation.landscape:
return headerTextTheme.display2.copyWith(fontSize: 50.0); return headerTextTheme.headline3.copyWith(fontSize: 50.0);
} }
return null; return null;
} }
@ -1340,7 +1340,7 @@ class _DialState extends State<_Dial> with SingleTickerProviderStateMixin {
]; ];
_TappableLabel _buildTappableLabel(TextTheme textTheme, int value, String label, VoidCallback onTap) { _TappableLabel _buildTappableLabel(TextTheme textTheme, int value, String label, VoidCallback onTap) {
final TextStyle style = textTheme.subhead; final TextStyle style = textTheme.subtitle1;
final double labelScaleFactor = math.min(MediaQuery.of(context).textScaleFactor, 2.0); final double labelScaleFactor = math.min(MediaQuery.of(context).textScaleFactor, 2.0);
return _TappableLabel( return _TappableLabel(
value: value, value: value,

View File

@ -800,7 +800,7 @@ class _ToggleButton extends StatelessWidget {
currentFillColor = theme.colorScheme.surface.withOpacity(0.0); currentFillColor = theme.colorScheme.surface.withOpacity(0.0);
} }
final TextStyle currentTextStyle = textStyle ?? toggleButtonsTheme.textStyle ?? theme.textTheme.body1; final TextStyle currentTextStyle = textStyle ?? toggleButtonsTheme.textStyle ?? theme.textTheme.bodyText2;
final BoxConstraints currentConstraints = constraints ?? toggleButtonsTheme.constraints ?? const BoxConstraints(minWidth: kMinInteractiveDimension, minHeight: kMinInteractiveDimension); final BoxConstraints currentConstraints = constraints ?? toggleButtonsTheme.constraints ?? const BoxConstraints(minWidth: kMinInteractiveDimension, minHeight: kMinInteractiveDimension);
final Widget result = ClipRRect( final Widget result = ClipRRect(

View File

@ -130,9 +130,9 @@ class Tooltip extends StatefulWidget {
/// ///
/// If null, the message's [TextStyle] will be determined based on /// If null, the message's [TextStyle] will be determined based on
/// [ThemeData]. If [ThemeData.brightness] is set to [Brightness.dark], /// [ThemeData]. If [ThemeData.brightness] is set to [Brightness.dark],
/// [ThemeData.textTheme.body1] will be used with [Colors.white]. Otherwise, /// [ThemeData.textTheme.bodyText2] will be used with [Colors.white]. Otherwise,
/// if [ThemeData.brightness] is set to [Brightness.light], /// if [ThemeData.brightness] is set to [Brightness.light],
/// [ThemeData.textTheme.body1] will be used with [Colors.black]. /// [ThemeData.textTheme.bodyText2] will be used with [Colors.black].
final TextStyle textStyle; final TextStyle textStyle;
/// The length of time that a pointer must hover over a tooltip's widget /// The length of time that a pointer must hover over a tooltip's widget
@ -362,7 +362,7 @@ class _TooltipState extends State<Tooltip> with SingleTickerProviderStateMixin {
TextStyle defaultTextStyle; TextStyle defaultTextStyle;
BoxDecoration defaultDecoration; BoxDecoration defaultDecoration;
if (theme.brightness == Brightness.dark) { if (theme.brightness == Brightness.dark) {
defaultTextStyle = theme.textTheme.body1.copyWith( defaultTextStyle = theme.textTheme.bodyText2.copyWith(
color: Colors.black, color: Colors.black,
); );
defaultDecoration = BoxDecoration( defaultDecoration = BoxDecoration(
@ -370,7 +370,7 @@ class _TooltipState extends State<Tooltip> with SingleTickerProviderStateMixin {
borderRadius: const BorderRadius.all(Radius.circular(4)), borderRadius: const BorderRadius.all(Radius.circular(4)),
); );
} else { } else {
defaultTextStyle = theme.textTheme.body1.copyWith( defaultTextStyle = theme.textTheme.bodyText2.copyWith(
color: Colors.white, color: Colors.white,
); );
defaultDecoration = BoxDecoration( defaultDecoration = BoxDecoration(
@ -504,7 +504,7 @@ class _TooltipOverlay extends StatelessWidget {
child: ConstrainedBox( child: ConstrainedBox(
constraints: BoxConstraints(minHeight: height), constraints: BoxConstraints(minHeight: height),
child: DefaultTextStyle( child: DefaultTextStyle(
style: Theme.of(context).textTheme.body1, style: Theme.of(context).textTheme.bodyText2,
child: Container( child: Container(
decoration: decoration, decoration: decoration,
padding: padding, padding: padding,

View File

@ -53,10 +53,12 @@ enum ScriptCategory {
/// `Theme.of(context).primaryTextTheme` or /// `Theme.of(context).primaryTextTheme` or
/// `Theme.of(context).accentTextTheme`. /// `Theme.of(context).accentTextTheme`.
/// ///
/// The color text themes are [blackMountainView], /// The color text themes are [blackMountainView], [whiteMountainView],
/// [whiteMountainView], and [blackCupertino] and [whiteCupertino]. The /// [blackCupertino], and [whiteCupertino]. The Mountain View theme [TextStyles]
/// Mountain View theme [TextStyles] are based on the Roboto fonts and the /// are based on the Roboto fonts as used on Android. The Cupertino themes are
/// Cupertino themes are based on the San Francisco fonts. /// based on the [San Francisco
/// font](https://developer.apple.com/ios/human-interface-guidelines/visual-design/typography/)
/// fonts as used by Apple on iOS.
/// ///
/// Two sets of geometry themes are provided: 2014 and 2018. The 2014 themes /// Two sets of geometry themes are provided: 2014 and 2018. The 2014 themes
/// correspond to the original version of the Material Design spec and are /// correspond to the original version of the Material Design spec and are
@ -64,18 +66,13 @@ enum ScriptCategory {
/// specification and feature different font sizes, font weights, and /// specification and feature different font sizes, font weights, and
/// letter spacing values. /// letter spacing values.
/// ///
/// By default, [ThemeData.typography] is /// By default, [ThemeData.typography] is `Typography.material2014(platform:
/// `Typography(platform: platform)` which uses [englishLike2014], /// platform)` which uses [englishLike2014], [dense2014] and [tall2014]. To use
/// [dense2014] and [tall2014]. To use the 2018 text theme /// the 2018 text theme geometries, specify a value using the [material2018]
/// geometries, specify a typography value: /// constructor:
/// ///
/// ```dart /// ```dart
/// Typography( /// typography: Typography.material2018(platform: platform)
/// platorm: platform,
/// englishLike: Typography.englishLike2018,
/// dense: Typography.dense2018,
/// tall: Typography.tall2018,
/// )
/// ``` /// ```
/// ///
/// See also: /// See also:
@ -88,6 +85,27 @@ enum ScriptCategory {
class Typography extends Diagnosticable { class Typography extends Diagnosticable {
/// Creates a typography instance. /// Creates a typography instance.
/// ///
/// This constructor is identical to [Typography.material2014]. It is
/// deprecated because the 2014 material design defaults used by that
/// constructor are obsolete. The current material design specification
/// recommendations are those reflected by [Typography.material2018].
@Deprecated(
'The default Typography constructor defaults to the 2014 material design defaults. '
'Applications are urged to migrate to Typography.material2018(), or, if the 2014 defaults '
'are desired, to explicitly request them using Typography.material2014(). '
'This feature was deprecated after v1.13.8.'
)
factory Typography({
TargetPlatform platform,
TextTheme black,
TextTheme white,
TextTheme englishLike,
TextTheme dense,
TextTheme tall,
}) = Typography.material2014;
/// Creates a typography instance using material design's 2014 defaults.
///
/// If [platform] is [TargetPlatform.iOS] or [TargetPlatform.macOS], the /// If [platform] is [TargetPlatform.iOS] or [TargetPlatform.macOS], the
/// default values for [black] and [white] are [blackCupertino] and /// default values for [black] and [white] are [blackCupertino] and
/// [whiteCupertino] respectively. Otherwise they are [blackMountainView] and /// [whiteCupertino] respectively. Otherwise they are [blackMountainView] and
@ -96,7 +114,7 @@ class Typography extends Diagnosticable {
/// ///
/// The default values for [englishLike], [dense], and [tall] are /// The default values for [englishLike], [dense], and [tall] are
/// [englishLike2014], [dense2014], and [tall2014]. /// [englishLike2014], [dense2014], and [tall2014].
factory Typography({ factory Typography.material2014({
TargetPlatform platform = TargetPlatform.android, TargetPlatform platform = TargetPlatform.android,
TextTheme black, TextTheme black,
TextTheme white, TextTheme white,
@ -105,6 +123,55 @@ class Typography extends Diagnosticable {
TextTheme tall, TextTheme tall,
}) { }) {
assert(platform != null || (black != null && white != null)); assert(platform != null || (black != null && white != null));
return Typography._withPlatform(
platform,
black, white,
englishLike ?? englishLike2014,
dense ?? dense2014,
tall ?? tall2014,
);
}
/// Creates a typography instance using material design's 2018 defaults.
///
/// If [platform] is [TargetPlatform.iOS] or [TargetPlatform.macOS], the
/// default values for [black] and [white] are [blackCupertino] and
/// [whiteCupertino] respectively. Otherwise they are [blackMountainView] and
/// [whiteMoutainView]. If [platform] is null then both [black] and [white]
/// must be specified.
///
/// The default values for [englishLike], [dense], and [tall] are
/// [englishLike2018], [dense2018], and [tall2018].
factory Typography.material2018({
TargetPlatform platform = TargetPlatform.android,
TextTheme black,
TextTheme white,
TextTheme englishLike,
TextTheme dense,
TextTheme tall,
}) {
assert(platform != null || (black != null && white != null));
return Typography._withPlatform(
platform,
black, white,
englishLike ?? englishLike2018,
dense ?? dense2018,
tall ?? tall2018,
);
}
factory Typography._withPlatform(
TargetPlatform platform,
TextTheme black,
TextTheme white,
TextTheme englishLike,
TextTheme dense,
TextTheme tall,
) {
assert(platform != null || (black != null && white != null));
assert(englishLike != null);
assert(dense != null);
assert(tall != null);
switch (platform) { switch (platform) {
case TargetPlatform.iOS: case TargetPlatform.iOS:
case TargetPlatform.macOS: case TargetPlatform.macOS:
@ -116,9 +183,6 @@ class Typography extends Diagnosticable {
black ??= blackMountainView; black ??= blackMountainView;
white ??= whiteMountainView; white ??= whiteMountainView;
} }
englishLike ??= englishLike2014;
dense ??= dense2014;
tall ??= tall2014;
return Typography._(black, white, englishLike, dense, tall); return Typography._(black, white, englishLike, dense, tall);
} }
@ -206,12 +270,12 @@ class Typography extends Diagnosticable {
TextTheme dense, TextTheme dense,
TextTheme tall, TextTheme tall,
}) { }) {
return Typography( return Typography._(
black: black ?? this.black, black ?? this.black,
white: white ?? this.white, white ?? this.white,
englishLike: englishLike ?? this.englishLike, englishLike ?? this.englishLike,
dense: dense ?? this.dense, dense ?? this.dense,
tall: tall ?? this.tall, tall ?? this.tall,
); );
} }
@ -219,12 +283,12 @@ class Typography extends Diagnosticable {
/// ///
/// {@macro dart.ui.shadow.lerp} /// {@macro dart.ui.shadow.lerp}
static Typography lerp(Typography a, Typography b, double t) { static Typography lerp(Typography a, Typography b, double t) {
return Typography( return Typography._(
black: TextTheme.lerp(a.black, b.black, t), TextTheme.lerp(a.black, b.black, t),
white: TextTheme.lerp(a.white, b.white, t), TextTheme.lerp(a.white, b.white, t),
englishLike: TextTheme.lerp(a.englishLike, b.englishLike, t), TextTheme.lerp(a.englishLike, b.englishLike, t),
dense: TextTheme.lerp(a.dense, b.dense, t), TextTheme.lerp(a.dense, b.dense, t),
tall: TextTheme.lerp(a.tall, b.tall, t), TextTheme.lerp(a.tall, b.tall, t),
); );
} }
@ -256,7 +320,7 @@ class Typography extends Diagnosticable {
@override @override
void debugFillProperties(DiagnosticPropertiesBuilder properties) { void debugFillProperties(DiagnosticPropertiesBuilder properties) {
super.debugFillProperties(properties); super.debugFillProperties(properties);
final Typography defaultTypography = Typography(); final Typography defaultTypography = Typography.material2014();
properties.add(DiagnosticsProperty<TextTheme>('black', black, defaultValue: defaultTypography.black)); properties.add(DiagnosticsProperty<TextTheme>('black', black, defaultValue: defaultTypography.black));
properties.add(DiagnosticsProperty<TextTheme>('white', white, defaultValue: defaultTypography.white)); properties.add(DiagnosticsProperty<TextTheme>('white', white, defaultValue: defaultTypography.white));
properties.add(DiagnosticsProperty<TextTheme>('englishLike', englishLike, defaultValue: defaultTypography.englishLike)); properties.add(DiagnosticsProperty<TextTheme>('englishLike', englishLike, defaultValue: defaultTypography.englishLike));
@ -268,94 +332,94 @@ class Typography extends Diagnosticable {
/// ///
/// This [TextTheme] provides color but not geometry (font size, weight, etc). /// This [TextTheme] provides color but not geometry (font size, weight, etc).
static const TextTheme blackMountainView = TextTheme( static const TextTheme blackMountainView = TextTheme(
display4 : TextStyle(debugLabel: 'blackMountainView display4', fontFamily: 'Roboto', inherit: true, color: Colors.black54, decoration: TextDecoration.none), headline1 : TextStyle(debugLabel: 'blackMountainView headline1', fontFamily: 'Roboto', inherit: true, color: Colors.black54, decoration: TextDecoration.none),
display3 : TextStyle(debugLabel: 'blackMountainView display3', fontFamily: 'Roboto', inherit: true, color: Colors.black54, decoration: TextDecoration.none), headline2 : TextStyle(debugLabel: 'blackMountainView headline2', fontFamily: 'Roboto', inherit: true, color: Colors.black54, decoration: TextDecoration.none),
display2 : TextStyle(debugLabel: 'blackMountainView display2', fontFamily: 'Roboto', inherit: true, color: Colors.black54, decoration: TextDecoration.none), headline3 : TextStyle(debugLabel: 'blackMountainView headline3', fontFamily: 'Roboto', inherit: true, color: Colors.black54, decoration: TextDecoration.none),
display1 : TextStyle(debugLabel: 'blackMountainView display1', fontFamily: 'Roboto', inherit: true, color: Colors.black54, decoration: TextDecoration.none), headline4 : TextStyle(debugLabel: 'blackMountainView headline4', fontFamily: 'Roboto', inherit: true, color: Colors.black54, decoration: TextDecoration.none),
headline : TextStyle(debugLabel: 'blackMountainView headline', fontFamily: 'Roboto', inherit: true, color: Colors.black87, decoration: TextDecoration.none), headline5 : TextStyle(debugLabel: 'blackMountainView headline5', fontFamily: 'Roboto', inherit: true, color: Colors.black87, decoration: TextDecoration.none),
title : TextStyle(debugLabel: 'blackMountainView title', fontFamily: 'Roboto', inherit: true, color: Colors.black87, decoration: TextDecoration.none), headline6 : TextStyle(debugLabel: 'blackMountainView headline6', fontFamily: 'Roboto', inherit: true, color: Colors.black87, decoration: TextDecoration.none),
subhead : TextStyle(debugLabel: 'blackMountainView subhead', fontFamily: 'Roboto', inherit: true, color: Colors.black87, decoration: TextDecoration.none), bodyText1 : TextStyle(debugLabel: 'blackMountainView bodyText1', fontFamily: 'Roboto', inherit: true, color: Colors.black87, decoration: TextDecoration.none),
body2 : TextStyle(debugLabel: 'blackMountainView body2', fontFamily: 'Roboto', inherit: true, color: Colors.black87, decoration: TextDecoration.none), bodyText2 : TextStyle(debugLabel: 'blackMountainView bodyText2', fontFamily: 'Roboto', inherit: true, color: Colors.black87, decoration: TextDecoration.none),
body1 : TextStyle(debugLabel: 'blackMountainView body1', fontFamily: 'Roboto', inherit: true, color: Colors.black87, decoration: TextDecoration.none), subtitle1 : TextStyle(debugLabel: 'blackMountainView subtitle1', fontFamily: 'Roboto', inherit: true, color: Colors.black87, decoration: TextDecoration.none),
caption : TextStyle(debugLabel: 'blackMountainView caption', fontFamily: 'Roboto', inherit: true, color: Colors.black54, decoration: TextDecoration.none), subtitle2 : TextStyle(debugLabel: 'blackMountainView subtitle2', fontFamily: 'Roboto', inherit: true, color: Colors.black, decoration: TextDecoration.none),
button : TextStyle(debugLabel: 'blackMountainView button', fontFamily: 'Roboto', inherit: true, color: Colors.black87, decoration: TextDecoration.none), caption : TextStyle(debugLabel: 'blackMountainView caption', fontFamily: 'Roboto', inherit: true, color: Colors.black54, decoration: TextDecoration.none),
subtitle : TextStyle(debugLabel: 'blackMountainView subtitle', fontFamily: 'Roboto', inherit: true, color: Colors.black, decoration: TextDecoration.none), button : TextStyle(debugLabel: 'blackMountainView button', fontFamily: 'Roboto', inherit: true, color: Colors.black87, decoration: TextDecoration.none),
overline : TextStyle(debugLabel: 'blackMountainView overline', fontFamily: 'Roboto', inherit: true, color: Colors.black, decoration: TextDecoration.none), overline : TextStyle(debugLabel: 'blackMountainView overline', fontFamily: 'Roboto', inherit: true, color: Colors.black, decoration: TextDecoration.none),
); );
/// A material design text theme with light glyphs based on Roboto. /// A material design text theme with light glyphs based on Roboto.
/// ///
/// This [TextTheme] provides color but not geometry (font size, weight, etc). /// This [TextTheme] provides color but not geometry (font size, weight, etc).
static const TextTheme whiteMountainView = TextTheme( static const TextTheme whiteMountainView = TextTheme(
display4 : TextStyle(debugLabel: 'whiteMountainView display4', fontFamily: 'Roboto', inherit: true, color: Colors.white70, decoration: TextDecoration.none), headline1 : TextStyle(debugLabel: 'whiteMountainView headline1', fontFamily: 'Roboto', inherit: true, color: Colors.white70, decoration: TextDecoration.none),
display3 : TextStyle(debugLabel: 'whiteMountainView display3', fontFamily: 'Roboto', inherit: true, color: Colors.white70, decoration: TextDecoration.none), headline2 : TextStyle(debugLabel: 'whiteMountainView headline2', fontFamily: 'Roboto', inherit: true, color: Colors.white70, decoration: TextDecoration.none),
display2 : TextStyle(debugLabel: 'whiteMountainView display2', fontFamily: 'Roboto', inherit: true, color: Colors.white70, decoration: TextDecoration.none), headline3 : TextStyle(debugLabel: 'whiteMountainView headline3', fontFamily: 'Roboto', inherit: true, color: Colors.white70, decoration: TextDecoration.none),
display1 : TextStyle(debugLabel: 'whiteMountainView display1', fontFamily: 'Roboto', inherit: true, color: Colors.white70, decoration: TextDecoration.none), headline4 : TextStyle(debugLabel: 'whiteMountainView headline4', fontFamily: 'Roboto', inherit: true, color: Colors.white70, decoration: TextDecoration.none),
headline : TextStyle(debugLabel: 'whiteMountainView headline', fontFamily: 'Roboto', inherit: true, color: Colors.white, decoration: TextDecoration.none), headline5 : TextStyle(debugLabel: 'whiteMountainView headline5', fontFamily: 'Roboto', inherit: true, color: Colors.white, decoration: TextDecoration.none),
title : TextStyle(debugLabel: 'whiteMountainView title', fontFamily: 'Roboto', inherit: true, color: Colors.white, decoration: TextDecoration.none), headline6 : TextStyle(debugLabel: 'whiteMountainView headline6', fontFamily: 'Roboto', inherit: true, color: Colors.white, decoration: TextDecoration.none),
subhead : TextStyle(debugLabel: 'whiteMountainView subhead', fontFamily: 'Roboto', inherit: true, color: Colors.white, decoration: TextDecoration.none), bodyText1 : TextStyle(debugLabel: 'whiteMountainView bodyText1', fontFamily: 'Roboto', inherit: true, color: Colors.white, decoration: TextDecoration.none),
body2 : TextStyle(debugLabel: 'whiteMountainView body2', fontFamily: 'Roboto', inherit: true, color: Colors.white, decoration: TextDecoration.none), bodyText2 : TextStyle(debugLabel: 'whiteMountainView bodyText2', fontFamily: 'Roboto', inherit: true, color: Colors.white, decoration: TextDecoration.none),
body1 : TextStyle(debugLabel: 'whiteMountainView body1', fontFamily: 'Roboto', inherit: true, color: Colors.white, decoration: TextDecoration.none), subtitle1 : TextStyle(debugLabel: 'whiteMountainView subtitle1', fontFamily: 'Roboto', inherit: true, color: Colors.white, decoration: TextDecoration.none),
caption : TextStyle(debugLabel: 'whiteMountainView caption', fontFamily: 'Roboto', inherit: true, color: Colors.white70, decoration: TextDecoration.none), subtitle2 : TextStyle(debugLabel: 'whiteMountainView subtitle2', fontFamily: 'Roboto', inherit: true, color: Colors.white, decoration: TextDecoration.none),
button : TextStyle(debugLabel: 'whiteMountainView button', fontFamily: 'Roboto', inherit: true, color: Colors.white, decoration: TextDecoration.none), caption : TextStyle(debugLabel: 'whiteMountainView caption', fontFamily: 'Roboto', inherit: true, color: Colors.white70, decoration: TextDecoration.none),
subtitle : TextStyle(debugLabel: 'whiteMountainView subtitle', fontFamily: 'Roboto', inherit: true, color: Colors.white, decoration: TextDecoration.none), button : TextStyle(debugLabel: 'whiteMountainView button', fontFamily: 'Roboto', inherit: true, color: Colors.white, decoration: TextDecoration.none),
overline : TextStyle(debugLabel: 'whiteMountainView overline', fontFamily: 'Roboto', inherit: true, color: Colors.white, decoration: TextDecoration.none), overline : TextStyle(debugLabel: 'whiteMountainView overline', fontFamily: 'Roboto', inherit: true, color: Colors.white, decoration: TextDecoration.none),
); );
/// A material design text theme with dark glyphs based on San Francisco. /// A material design text theme with dark glyphs based on San Francisco.
/// ///
/// This [TextTheme] provides color but not geometry (font size, weight, etc). /// This [TextTheme] provides color but not geometry (font size, weight, etc).
static const TextTheme blackCupertino = TextTheme( static const TextTheme blackCupertino = TextTheme(
display4 : TextStyle(debugLabel: 'blackCupertino display4', fontFamily: '.SF UI Display', inherit: true, color: Colors.black54, decoration: TextDecoration.none), headline1 : TextStyle(debugLabel: 'blackCupertino headline1', fontFamily: '.SF UI Display', inherit: true, color: Colors.black54, decoration: TextDecoration.none),
display3 : TextStyle(debugLabel: 'blackCupertino display3', fontFamily: '.SF UI Display', inherit: true, color: Colors.black54, decoration: TextDecoration.none), headline2 : TextStyle(debugLabel: 'blackCupertino headline2', fontFamily: '.SF UI Display', inherit: true, color: Colors.black54, decoration: TextDecoration.none),
display2 : TextStyle(debugLabel: 'blackCupertino display2', fontFamily: '.SF UI Display', inherit: true, color: Colors.black54, decoration: TextDecoration.none), headline3 : TextStyle(debugLabel: 'blackCupertino headline3', fontFamily: '.SF UI Display', inherit: true, color: Colors.black54, decoration: TextDecoration.none),
display1 : TextStyle(debugLabel: 'blackCupertino display1', fontFamily: '.SF UI Display', inherit: true, color: Colors.black54, decoration: TextDecoration.none), headline4 : TextStyle(debugLabel: 'blackCupertino headline4', fontFamily: '.SF UI Display', inherit: true, color: Colors.black54, decoration: TextDecoration.none),
headline : TextStyle(debugLabel: 'blackCupertino headline', fontFamily: '.SF UI Display', inherit: true, color: Colors.black87, decoration: TextDecoration.none), headline5 : TextStyle(debugLabel: 'blackCupertino headline5', fontFamily: '.SF UI Display', inherit: true, color: Colors.black87, decoration: TextDecoration.none),
title : TextStyle(debugLabel: 'blackCupertino title', fontFamily: '.SF UI Display', inherit: true, color: Colors.black87, decoration: TextDecoration.none), headline6 : TextStyle(debugLabel: 'blackCupertino headline6', fontFamily: '.SF UI Display', inherit: true, color: Colors.black87, decoration: TextDecoration.none),
subhead : TextStyle(debugLabel: 'blackCupertino subhead', fontFamily: '.SF UI Text', inherit: true, color: Colors.black87, decoration: TextDecoration.none), bodyText1 : TextStyle(debugLabel: 'blackCupertino bodyText1', fontFamily: '.SF UI Text', inherit: true, color: Colors.black87, decoration: TextDecoration.none),
body2 : TextStyle(debugLabel: 'blackCupertino body2', fontFamily: '.SF UI Text', inherit: true, color: Colors.black87, decoration: TextDecoration.none), bodyText2 : TextStyle(debugLabel: 'blackCupertino bodyText2', fontFamily: '.SF UI Text', inherit: true, color: Colors.black87, decoration: TextDecoration.none),
body1 : TextStyle(debugLabel: 'blackCupertino body1', fontFamily: '.SF UI Text', inherit: true, color: Colors.black87, decoration: TextDecoration.none), subtitle1 : TextStyle(debugLabel: 'blackCupertino subtitle1', fontFamily: '.SF UI Text', inherit: true, color: Colors.black87, decoration: TextDecoration.none),
caption : TextStyle(debugLabel: 'blackCupertino caption', fontFamily: '.SF UI Text', inherit: true, color: Colors.black54, decoration: TextDecoration.none), subtitle2 : TextStyle(debugLabel: 'blackCupertino subtitle2', fontFamily: '.SF UI Text', inherit: true, color: Colors.black, decoration: TextDecoration.none),
button : TextStyle(debugLabel: 'blackCupertino button', fontFamily: '.SF UI Text', inherit: true, color: Colors.black87, decoration: TextDecoration.none), caption : TextStyle(debugLabel: 'blackCupertino caption', fontFamily: '.SF UI Text', inherit: true, color: Colors.black54, decoration: TextDecoration.none),
subtitle : TextStyle(debugLabel: 'blackCupertino subtitle', fontFamily: '.SF UI Text', inherit: true, color: Colors.black, decoration: TextDecoration.none), button : TextStyle(debugLabel: 'blackCupertino button', fontFamily: '.SF UI Text', inherit: true, color: Colors.black87, decoration: TextDecoration.none),
overline : TextStyle(debugLabel: 'blackCupertino overline', fontFamily: '.SF UI Text', inherit: true, color: Colors.black, decoration: TextDecoration.none), overline : TextStyle(debugLabel: 'blackCupertino overline', fontFamily: '.SF UI Text', inherit: true, color: Colors.black, decoration: TextDecoration.none),
); );
/// A material design text theme with light glyphs based on San Francisco. /// A material design text theme with light glyphs based on San Francisco.
/// ///
/// This [TextTheme] provides color but not geometry (font size, weight, etc). /// This [TextTheme] provides color but not geometry (font size, weight, etc).
static const TextTheme whiteCupertino = TextTheme( static const TextTheme whiteCupertino = TextTheme(
display4 : TextStyle(debugLabel: 'whiteCupertino display4', fontFamily: '.SF UI Display', inherit: true, color: Colors.white70, decoration: TextDecoration.none), headline1 : TextStyle(debugLabel: 'whiteCupertino headline1', fontFamily: '.SF UI Display', inherit: true, color: Colors.white70, decoration: TextDecoration.none),
display3 : TextStyle(debugLabel: 'whiteCupertino display3', fontFamily: '.SF UI Display', inherit: true, color: Colors.white70, decoration: TextDecoration.none), headline2 : TextStyle(debugLabel: 'whiteCupertino headline2', fontFamily: '.SF UI Display', inherit: true, color: Colors.white70, decoration: TextDecoration.none),
display2 : TextStyle(debugLabel: 'whiteCupertino display2', fontFamily: '.SF UI Display', inherit: true, color: Colors.white70, decoration: TextDecoration.none), headline3 : TextStyle(debugLabel: 'whiteCupertino headline3', fontFamily: '.SF UI Display', inherit: true, color: Colors.white70, decoration: TextDecoration.none),
display1 : TextStyle(debugLabel: 'whiteCupertino display1', fontFamily: '.SF UI Display', inherit: true, color: Colors.white70, decoration: TextDecoration.none), headline4 : TextStyle(debugLabel: 'whiteCupertino headline4', fontFamily: '.SF UI Display', inherit: true, color: Colors.white70, decoration: TextDecoration.none),
headline : TextStyle(debugLabel: 'whiteCupertino headline', fontFamily: '.SF UI Display', inherit: true, color: Colors.white, decoration: TextDecoration.none), headline5 : TextStyle(debugLabel: 'whiteCupertino headline5', fontFamily: '.SF UI Display', inherit: true, color: Colors.white, decoration: TextDecoration.none),
title : TextStyle(debugLabel: 'whiteCupertino title', fontFamily: '.SF UI Display', inherit: true, color: Colors.white, decoration: TextDecoration.none), headline6 : TextStyle(debugLabel: 'whiteCupertino headline6', fontFamily: '.SF UI Display', inherit: true, color: Colors.white, decoration: TextDecoration.none),
subhead : TextStyle(debugLabel: 'whiteCupertino subhead', fontFamily: '.SF UI Text', inherit: true, color: Colors.white, decoration: TextDecoration.none), subtitle1 : TextStyle(debugLabel: 'whiteCupertino subtitle1', fontFamily: '.SF UI Text', inherit: true, color: Colors.white, decoration: TextDecoration.none),
body2 : TextStyle(debugLabel: 'whiteCupertino body2', fontFamily: '.SF UI Text', inherit: true, color: Colors.white, decoration: TextDecoration.none), bodyText1 : TextStyle(debugLabel: 'whiteCupertino bodyText1', fontFamily: '.SF UI Text', inherit: true, color: Colors.white, decoration: TextDecoration.none),
body1 : TextStyle(debugLabel: 'whiteCupertino body1', fontFamily: '.SF UI Text', inherit: true, color: Colors.white, decoration: TextDecoration.none), bodyText2 : TextStyle(debugLabel: 'whiteCupertino bodyText2', fontFamily: '.SF UI Text', inherit: true, color: Colors.white, decoration: TextDecoration.none),
caption : TextStyle(debugLabel: 'whiteCupertino caption', fontFamily: '.SF UI Text', inherit: true, color: Colors.white70, decoration: TextDecoration.none), caption : TextStyle(debugLabel: 'whiteCupertino caption', fontFamily: '.SF UI Text', inherit: true, color: Colors.white70, decoration: TextDecoration.none),
button : TextStyle(debugLabel: 'whiteCupertino button', fontFamily: '.SF UI Text', inherit: true, color: Colors.white, decoration: TextDecoration.none), button : TextStyle(debugLabel: 'whiteCupertino button', fontFamily: '.SF UI Text', inherit: true, color: Colors.white, decoration: TextDecoration.none),
subtitle : TextStyle(debugLabel: 'whiteCupertino subtitle', fontFamily: '.SF UI Text', inherit: true, color: Colors.white, decoration: TextDecoration.none), subtitle2 : TextStyle(debugLabel: 'whiteCupertino subtitle2', fontFamily: '.SF UI Text', inherit: true, color: Colors.white, decoration: TextDecoration.none),
overline : TextStyle(debugLabel: 'whiteCupertino overline', fontFamily: '.SF UI Text', inherit: true, color: Colors.white, decoration: TextDecoration.none), overline : TextStyle(debugLabel: 'whiteCupertino overline', fontFamily: '.SF UI Text', inherit: true, color: Colors.white, decoration: TextDecoration.none),
); );
/// Defines text geometry for [ScriptCategory.englishLike] scripts, such as /// Defines text geometry for [ScriptCategory.englishLike] scripts, such as
/// English, French, Russian, etc. /// English, French, Russian, etc.
static const TextTheme englishLike2014 = TextTheme( static const TextTheme englishLike2014 = TextTheme(
display4 : TextStyle(debugLabel: 'englishLike display4 2014', inherit: false, fontSize: 112.0, fontWeight: FontWeight.w100, textBaseline: TextBaseline.alphabetic), headline1 : TextStyle(debugLabel: 'englishLike display4 2014', inherit: false, fontSize: 112.0, fontWeight: FontWeight.w100, textBaseline: TextBaseline.alphabetic),
display3 : TextStyle(debugLabel: 'englishLike display3 2014', inherit: false, fontSize: 56.0, fontWeight: FontWeight.w400, textBaseline: TextBaseline.alphabetic), headline2 : TextStyle(debugLabel: 'englishLike display3 2014', inherit: false, fontSize: 56.0, fontWeight: FontWeight.w400, textBaseline: TextBaseline.alphabetic),
display2 : TextStyle(debugLabel: 'englishLike display2 2014', inherit: false, fontSize: 45.0, fontWeight: FontWeight.w400, textBaseline: TextBaseline.alphabetic), headline3 : TextStyle(debugLabel: 'englishLike display2 2014', inherit: false, fontSize: 45.0, fontWeight: FontWeight.w400, textBaseline: TextBaseline.alphabetic),
display1 : TextStyle(debugLabel: 'englishLike display1 2014', inherit: false, fontSize: 34.0, fontWeight: FontWeight.w400, textBaseline: TextBaseline.alphabetic), headline4 : TextStyle(debugLabel: 'englishLike display1 2014', inherit: false, fontSize: 34.0, fontWeight: FontWeight.w400, textBaseline: TextBaseline.alphabetic),
headline : TextStyle(debugLabel: 'englishLike headline 2014', inherit: false, fontSize: 24.0, fontWeight: FontWeight.w400, textBaseline: TextBaseline.alphabetic), headline5 : TextStyle(debugLabel: 'englishLike headline 2014', inherit: false, fontSize: 24.0, fontWeight: FontWeight.w400, textBaseline: TextBaseline.alphabetic),
title : TextStyle(debugLabel: 'englishLike title 2014', inherit: false, fontSize: 20.0, fontWeight: FontWeight.w500, textBaseline: TextBaseline.alphabetic), headline6 : TextStyle(debugLabel: 'englishLike title 2014', inherit: false, fontSize: 20.0, fontWeight: FontWeight.w500, textBaseline: TextBaseline.alphabetic),
subhead : TextStyle(debugLabel: 'englishLike subhead 2014', inherit: false, fontSize: 16.0, fontWeight: FontWeight.w400, textBaseline: TextBaseline.alphabetic), bodyText1 : TextStyle(debugLabel: 'englishLike body2 2014', inherit: false, fontSize: 14.0, fontWeight: FontWeight.w500, textBaseline: TextBaseline.alphabetic),
body2 : TextStyle(debugLabel: 'englishLike body2 2014', inherit: false, fontSize: 14.0, fontWeight: FontWeight.w500, textBaseline: TextBaseline.alphabetic), bodyText2 : TextStyle(debugLabel: 'englishLike body1 2014', inherit: false, fontSize: 14.0, fontWeight: FontWeight.w400, textBaseline: TextBaseline.alphabetic),
body1 : TextStyle(debugLabel: 'englishLike body1 2014', inherit: false, fontSize: 14.0, fontWeight: FontWeight.w400, textBaseline: TextBaseline.alphabetic), subtitle1 : TextStyle(debugLabel: 'englishLike subhead 2014', inherit: false, fontSize: 16.0, fontWeight: FontWeight.w400, textBaseline: TextBaseline.alphabetic),
caption : TextStyle(debugLabel: 'englishLike caption 2014', inherit: false, fontSize: 12.0, fontWeight: FontWeight.w400, textBaseline: TextBaseline.alphabetic), subtitle2 : TextStyle(debugLabel: 'englishLike subtitle 2014', inherit: false, fontSize: 14.0, fontWeight: FontWeight.w500, textBaseline: TextBaseline.alphabetic, letterSpacing: 0.1),
button : TextStyle(debugLabel: 'englishLike button 2014', inherit: false, fontSize: 14.0, fontWeight: FontWeight.w500, textBaseline: TextBaseline.alphabetic), caption : TextStyle(debugLabel: 'englishLike caption 2014', inherit: false, fontSize: 12.0, fontWeight: FontWeight.w400, textBaseline: TextBaseline.alphabetic),
subtitle : TextStyle(debugLabel: 'englishLike subtitle 2014', inherit: false, fontSize: 14.0, fontWeight: FontWeight.w500, textBaseline: TextBaseline.alphabetic, letterSpacing: 0.1), button : TextStyle(debugLabel: 'englishLike button 2014', inherit: false, fontSize: 14.0, fontWeight: FontWeight.w500, textBaseline: TextBaseline.alphabetic),
overline : TextStyle(debugLabel: 'englishLike overline 2014', inherit: false, fontSize: 10.0, fontWeight: FontWeight.w400, textBaseline: TextBaseline.alphabetic, letterSpacing: 1.5), overline : TextStyle(debugLabel: 'englishLike overline 2014', inherit: false, fontSize: 10.0, fontWeight: FontWeight.w400, textBaseline: TextBaseline.alphabetic, letterSpacing: 1.5),
); );
/// Defines text geometry for [ScriptCategory.englishLike] scripts, such as /// Defines text geometry for [ScriptCategory.englishLike] scripts, such as
@ -364,37 +428,37 @@ class Typography extends Diagnosticable {
/// The font sizes, weights, and letter spacings in this version match the /// The font sizes, weights, and letter spacings in this version match the
/// [latest Material Design specification](https://material.io/go/design-typography#typography-styles). /// [latest Material Design specification](https://material.io/go/design-typography#typography-styles).
static const TextTheme englishLike2018 = TextTheme( static const TextTheme englishLike2018 = TextTheme(
display4 : TextStyle(debugLabel: 'englishLike display4 2018', fontSize: 96.0, fontWeight: FontWeight.w300, textBaseline: TextBaseline.alphabetic, letterSpacing: -1.5), headline1 : TextStyle(debugLabel: 'englishLike headline1 2018', fontSize: 96.0, fontWeight: FontWeight.w300, textBaseline: TextBaseline.alphabetic, letterSpacing: -1.5),
display3 : TextStyle(debugLabel: 'englishLike display3 2018', fontSize: 60.0, fontWeight: FontWeight.w300, textBaseline: TextBaseline.alphabetic, letterSpacing: -0.5), headline2 : TextStyle(debugLabel: 'englishLike headline2 2018', fontSize: 60.0, fontWeight: FontWeight.w300, textBaseline: TextBaseline.alphabetic, letterSpacing: -0.5),
display2 : TextStyle(debugLabel: 'englishLike display2 2018', fontSize: 48.0, fontWeight: FontWeight.w400, textBaseline: TextBaseline.alphabetic, letterSpacing: 0.0), headline3 : TextStyle(debugLabel: 'englishLike headline3 2018', fontSize: 48.0, fontWeight: FontWeight.w400, textBaseline: TextBaseline.alphabetic, letterSpacing: 0.0),
display1 : TextStyle(debugLabel: 'englishLike display1 2018', fontSize: 34.0, fontWeight: FontWeight.w400, textBaseline: TextBaseline.alphabetic, letterSpacing: 0.25), headline4 : TextStyle(debugLabel: 'englishLike headline4 2018', fontSize: 34.0, fontWeight: FontWeight.w400, textBaseline: TextBaseline.alphabetic, letterSpacing: 0.25),
headline : TextStyle(debugLabel: 'englishLike headline 2018', fontSize: 24.0, fontWeight: FontWeight.w400, textBaseline: TextBaseline.alphabetic, letterSpacing: 0.0), headline5 : TextStyle(debugLabel: 'englishLike headline5 2018', fontSize: 24.0, fontWeight: FontWeight.w400, textBaseline: TextBaseline.alphabetic, letterSpacing: 0.0),
title : TextStyle(debugLabel: 'englishLike title 2018', fontSize: 20.0, fontWeight: FontWeight.w500, textBaseline: TextBaseline.alphabetic, letterSpacing: 0.15), headline6 : TextStyle(debugLabel: 'englishLike headline6 2018', fontSize: 20.0, fontWeight: FontWeight.w500, textBaseline: TextBaseline.alphabetic, letterSpacing: 0.15),
subhead : TextStyle(debugLabel: 'englishLike subhead 2018', fontSize: 16.0, fontWeight: FontWeight.w400, textBaseline: TextBaseline.alphabetic, letterSpacing: 0.15), bodyText1 : TextStyle(debugLabel: 'englishLike bodyText1 2018', fontSize: 14.0, fontWeight: FontWeight.w400, textBaseline: TextBaseline.alphabetic, letterSpacing: 0.25),
body2 : TextStyle(debugLabel: 'englishLike body2 2018', fontSize: 14.0, fontWeight: FontWeight.w400, textBaseline: TextBaseline.alphabetic, letterSpacing: 0.25), bodyText2 : TextStyle(debugLabel: 'englishLike bodyText2 2018', fontSize: 16.0, fontWeight: FontWeight.w400, textBaseline: TextBaseline.alphabetic, letterSpacing: 0.5),
body1 : TextStyle(debugLabel: 'englishLike body1 2018', fontSize: 16.0, fontWeight: FontWeight.w400, textBaseline: TextBaseline.alphabetic, letterSpacing: 0.5), subtitle1 : TextStyle(debugLabel: 'englishLike subtitle1 2018', fontSize: 16.0, fontWeight: FontWeight.w400, textBaseline: TextBaseline.alphabetic, letterSpacing: 0.15),
button : TextStyle(debugLabel: 'englishLike button 2018', fontSize: 14.0, fontWeight: FontWeight.w500, textBaseline: TextBaseline.alphabetic, letterSpacing: 0.75), subtitle2 : TextStyle(debugLabel: 'englishLike subtitle2 2018', fontSize: 14.0, fontWeight: FontWeight.w500, textBaseline: TextBaseline.alphabetic, letterSpacing: 0.1),
caption : TextStyle(debugLabel: 'englishLike caption 2018', fontSize: 12.0, fontWeight: FontWeight.w400, textBaseline: TextBaseline.alphabetic, letterSpacing: 0.4), button : TextStyle(debugLabel: 'englishLike button 2018', fontSize: 14.0, fontWeight: FontWeight.w500, textBaseline: TextBaseline.alphabetic, letterSpacing: 0.75),
subtitle : TextStyle(debugLabel: 'englishLike subtitle 2018', fontSize: 14.0, fontWeight: FontWeight.w500, textBaseline: TextBaseline.alphabetic, letterSpacing: 0.1), caption : TextStyle(debugLabel: 'englishLike caption 2018', fontSize: 12.0, fontWeight: FontWeight.w400, textBaseline: TextBaseline.alphabetic, letterSpacing: 0.4),
overline : TextStyle(debugLabel: 'englishLike overline 2018', fontSize: 10.0, fontWeight: FontWeight.w400, textBaseline: TextBaseline.alphabetic, letterSpacing: 1.5), overline : TextStyle(debugLabel: 'englishLike overline 2018', fontSize: 10.0, fontWeight: FontWeight.w400, textBaseline: TextBaseline.alphabetic, letterSpacing: 1.5),
); );
/// Defines text geometry for dense scripts, such as Chinese, Japanese /// Defines text geometry for dense scripts, such as Chinese, Japanese
/// and Korean. /// and Korean.
static const TextTheme dense2014 = TextTheme( static const TextTheme dense2014 = TextTheme(
display4 : TextStyle(debugLabel: 'dense display4 2014', inherit: false, fontSize: 112.0, fontWeight: FontWeight.w100, textBaseline: TextBaseline.ideographic), headline1 : TextStyle(debugLabel: 'dense display4 2014', inherit: false, fontSize: 112.0, fontWeight: FontWeight.w100, textBaseline: TextBaseline.ideographic),
display3 : TextStyle(debugLabel: 'dense display3 2014', inherit: false, fontSize: 56.0, fontWeight: FontWeight.w400, textBaseline: TextBaseline.ideographic), headline2 : TextStyle(debugLabel: 'dense display3 2014', inherit: false, fontSize: 56.0, fontWeight: FontWeight.w400, textBaseline: TextBaseline.ideographic),
display2 : TextStyle(debugLabel: 'dense display2 2014', inherit: false, fontSize: 45.0, fontWeight: FontWeight.w400, textBaseline: TextBaseline.ideographic), headline3 : TextStyle(debugLabel: 'dense display2 2014', inherit: false, fontSize: 45.0, fontWeight: FontWeight.w400, textBaseline: TextBaseline.ideographic),
display1 : TextStyle(debugLabel: 'dense display1 2014', inherit: false, fontSize: 34.0, fontWeight: FontWeight.w400, textBaseline: TextBaseline.ideographic), headline4 : TextStyle(debugLabel: 'dense display1 2014', inherit: false, fontSize: 34.0, fontWeight: FontWeight.w400, textBaseline: TextBaseline.ideographic),
headline : TextStyle(debugLabel: 'dense headline 2014', inherit: false, fontSize: 24.0, fontWeight: FontWeight.w400, textBaseline: TextBaseline.ideographic), headline5 : TextStyle(debugLabel: 'dense headline 2014', inherit: false, fontSize: 24.0, fontWeight: FontWeight.w400, textBaseline: TextBaseline.ideographic),
title : TextStyle(debugLabel: 'dense title 2014', inherit: false, fontSize: 21.0, fontWeight: FontWeight.w500, textBaseline: TextBaseline.ideographic), headline6 : TextStyle(debugLabel: 'dense title 2014', inherit: false, fontSize: 21.0, fontWeight: FontWeight.w500, textBaseline: TextBaseline.ideographic),
subhead : TextStyle(debugLabel: 'dense subhead 2014', inherit: false, fontSize: 17.0, fontWeight: FontWeight.w400, textBaseline: TextBaseline.ideographic), bodyText1 : TextStyle(debugLabel: 'dense body2 2014', inherit: false, fontSize: 15.0, fontWeight: FontWeight.w500, textBaseline: TextBaseline.ideographic),
body2 : TextStyle(debugLabel: 'dense body2 2014', inherit: false, fontSize: 15.0, fontWeight: FontWeight.w500, textBaseline: TextBaseline.ideographic), bodyText2 : TextStyle(debugLabel: 'dense body1 2014', inherit: false, fontSize: 15.0, fontWeight: FontWeight.w400, textBaseline: TextBaseline.ideographic),
body1 : TextStyle(debugLabel: 'dense body1 2014', inherit: false, fontSize: 15.0, fontWeight: FontWeight.w400, textBaseline: TextBaseline.ideographic), subtitle1 : TextStyle(debugLabel: 'dense subhead 2014', inherit: false, fontSize: 17.0, fontWeight: FontWeight.w400, textBaseline: TextBaseline.ideographic),
caption : TextStyle(debugLabel: 'dense caption 2014', inherit: false, fontSize: 13.0, fontWeight: FontWeight.w400, textBaseline: TextBaseline.ideographic), subtitle2 : TextStyle(debugLabel: 'dense subtitle 2014', inherit: false, fontSize: 15.0, fontWeight: FontWeight.w500, textBaseline: TextBaseline.ideographic),
button : TextStyle(debugLabel: 'dense button 2014', inherit: false, fontSize: 15.0, fontWeight: FontWeight.w500, textBaseline: TextBaseline.ideographic), caption : TextStyle(debugLabel: 'dense caption 2014', inherit: false, fontSize: 13.0, fontWeight: FontWeight.w400, textBaseline: TextBaseline.ideographic),
subtitle : TextStyle(debugLabel: 'dense subtitle 2014', inherit: false, fontSize: 15.0, fontWeight: FontWeight.w500, textBaseline: TextBaseline.ideographic), button : TextStyle(debugLabel: 'dense button 2014', inherit: false, fontSize: 15.0, fontWeight: FontWeight.w500, textBaseline: TextBaseline.ideographic),
overline : TextStyle(debugLabel: 'dense overline 2014', inherit: false, fontSize: 11.0, fontWeight: FontWeight.w400, textBaseline: TextBaseline.ideographic), overline : TextStyle(debugLabel: 'dense overline 2014', inherit: false, fontSize: 11.0, fontWeight: FontWeight.w400, textBaseline: TextBaseline.ideographic),
); );
/// Defines text geometry for dense scripts, such as Chinese, Japanese /// Defines text geometry for dense scripts, such as Chinese, Japanese
@ -403,36 +467,36 @@ class Typography extends Diagnosticable {
/// The font sizes, weights, and letter spacings in this version match the /// The font sizes, weights, and letter spacings in this version match the
/// latest [Material Design specification](https://material.io/go/design-typography#typography-styles). /// latest [Material Design specification](https://material.io/go/design-typography#typography-styles).
static const TextTheme dense2018 = TextTheme( static const TextTheme dense2018 = TextTheme(
display4 : TextStyle(debugLabel: 'dense display4 2018', fontSize: 96.0, fontWeight: FontWeight.w100, textBaseline: TextBaseline.ideographic), headline1 : TextStyle(debugLabel: 'dense headline1 2018', fontSize: 96.0, fontWeight: FontWeight.w100, textBaseline: TextBaseline.ideographic),
display3 : TextStyle(debugLabel: 'dense display3 2018', fontSize: 60.0, fontWeight: FontWeight.w100, textBaseline: TextBaseline.ideographic), headline2 : TextStyle(debugLabel: 'dense headline2 2018', fontSize: 60.0, fontWeight: FontWeight.w100, textBaseline: TextBaseline.ideographic),
display2 : TextStyle(debugLabel: 'dense display2 2018', fontSize: 48.0, fontWeight: FontWeight.w400, textBaseline: TextBaseline.ideographic), headline3 : TextStyle(debugLabel: 'dense headline3 2018', fontSize: 48.0, fontWeight: FontWeight.w400, textBaseline: TextBaseline.ideographic),
display1 : TextStyle(debugLabel: 'dense display1 2018', fontSize: 34.0, fontWeight: FontWeight.w400, textBaseline: TextBaseline.ideographic), headline4 : TextStyle(debugLabel: 'dense headline4 2018', fontSize: 34.0, fontWeight: FontWeight.w400, textBaseline: TextBaseline.ideographic),
headline : TextStyle(debugLabel: 'dense headline 2018', fontSize: 24.0, fontWeight: FontWeight.w400, textBaseline: TextBaseline.ideographic), headline5 : TextStyle(debugLabel: 'dense headline5 2018', fontSize: 24.0, fontWeight: FontWeight.w400, textBaseline: TextBaseline.ideographic),
title : TextStyle(debugLabel: 'dense title 2018', fontSize: 21.0, fontWeight: FontWeight.w500, textBaseline: TextBaseline.ideographic), headline6 : TextStyle(debugLabel: 'dense headline6 2018', fontSize: 21.0, fontWeight: FontWeight.w500, textBaseline: TextBaseline.ideographic),
subhead : TextStyle(debugLabel: 'dense subhead 2018', fontSize: 17.0, fontWeight: FontWeight.w400, textBaseline: TextBaseline.ideographic), bodyText1 : TextStyle(debugLabel: 'dense bodyText1 2018', fontSize: 17.0, fontWeight: FontWeight.w400, textBaseline: TextBaseline.ideographic),
body2 : TextStyle(debugLabel: 'dense body2 2018', fontSize: 17.0, fontWeight: FontWeight.w400, textBaseline: TextBaseline.ideographic), bodyText2 : TextStyle(debugLabel: 'dense bodyText2 2018', fontSize: 15.0, fontWeight: FontWeight.w400, textBaseline: TextBaseline.ideographic),
body1 : TextStyle(debugLabel: 'dense body1 2018', fontSize: 15.0, fontWeight: FontWeight.w400, textBaseline: TextBaseline.ideographic), subtitle1 : TextStyle(debugLabel: 'dense subtitle1 2018', fontSize: 17.0, fontWeight: FontWeight.w400, textBaseline: TextBaseline.ideographic),
caption : TextStyle(debugLabel: 'dense caption 2018', fontSize: 13.0, fontWeight: FontWeight.w400, textBaseline: TextBaseline.ideographic), subtitle2 : TextStyle(debugLabel: 'dense subtitle2 2018', fontSize: 15.0, fontWeight: FontWeight.w500, textBaseline: TextBaseline.ideographic),
button : TextStyle(debugLabel: 'dense button 2018', fontSize: 15.0, fontWeight: FontWeight.w500, textBaseline: TextBaseline.ideographic), button : TextStyle(debugLabel: 'dense button 2018', fontSize: 15.0, fontWeight: FontWeight.w500, textBaseline: TextBaseline.ideographic),
subtitle : TextStyle(debugLabel: 'dense subtitle 2018', fontSize: 15.0, fontWeight: FontWeight.w500, textBaseline: TextBaseline.ideographic), caption : TextStyle(debugLabel: 'dense caption 2018', fontSize: 13.0, fontWeight: FontWeight.w400, textBaseline: TextBaseline.ideographic),
overline : TextStyle(debugLabel: 'dense overline 2018', fontSize: 11.0, fontWeight: FontWeight.w400, textBaseline: TextBaseline.ideographic), overline : TextStyle(debugLabel: 'dense overline 2018', fontSize: 11.0, fontWeight: FontWeight.w400, textBaseline: TextBaseline.ideographic),
); );
/// Defines text geometry for tall scripts, such as Farsi, Hindi, and Thai. /// Defines text geometry for tall scripts, such as Farsi, Hindi, and Thai.
static const TextTheme tall2014 = TextTheme( static const TextTheme tall2014 = TextTheme(
display4 : TextStyle(debugLabel: 'tall display4 2014', inherit: false, fontSize: 112.0, fontWeight: FontWeight.w400, textBaseline: TextBaseline.alphabetic), headline1 : TextStyle(debugLabel: 'tall display4 2014', inherit: false, fontSize: 112.0, fontWeight: FontWeight.w400, textBaseline: TextBaseline.alphabetic),
display3 : TextStyle(debugLabel: 'tall display3 2014', inherit: false, fontSize: 56.0, fontWeight: FontWeight.w400, textBaseline: TextBaseline.alphabetic), headline2 : TextStyle(debugLabel: 'tall display3 2014', inherit: false, fontSize: 56.0, fontWeight: FontWeight.w400, textBaseline: TextBaseline.alphabetic),
display2 : TextStyle(debugLabel: 'tall display2 2014', inherit: false, fontSize: 45.0, fontWeight: FontWeight.w400, textBaseline: TextBaseline.alphabetic), headline3 : TextStyle(debugLabel: 'tall display2 2014', inherit: false, fontSize: 45.0, fontWeight: FontWeight.w400, textBaseline: TextBaseline.alphabetic),
display1 : TextStyle(debugLabel: 'tall display1 2014', inherit: false, fontSize: 34.0, fontWeight: FontWeight.w400, textBaseline: TextBaseline.alphabetic), headline4 : TextStyle(debugLabel: 'tall display1 2014', inherit: false, fontSize: 34.0, fontWeight: FontWeight.w400, textBaseline: TextBaseline.alphabetic),
headline : TextStyle(debugLabel: 'tall headline 2014', inherit: false, fontSize: 24.0, fontWeight: FontWeight.w400, textBaseline: TextBaseline.alphabetic), headline5 : TextStyle(debugLabel: 'tall headline 2014', inherit: false, fontSize: 24.0, fontWeight: FontWeight.w400, textBaseline: TextBaseline.alphabetic),
title : TextStyle(debugLabel: 'tall title 2014', inherit: false, fontSize: 21.0, fontWeight: FontWeight.w700, textBaseline: TextBaseline.alphabetic), headline6 : TextStyle(debugLabel: 'tall title 2014', inherit: false, fontSize: 21.0, fontWeight: FontWeight.w700, textBaseline: TextBaseline.alphabetic),
subhead : TextStyle(debugLabel: 'tall subhead 2014', inherit: false, fontSize: 17.0, fontWeight: FontWeight.w400, textBaseline: TextBaseline.alphabetic), bodyText1 : TextStyle(debugLabel: 'tall body2 2014', inherit: false, fontSize: 15.0, fontWeight: FontWeight.w700, textBaseline: TextBaseline.alphabetic),
body2 : TextStyle(debugLabel: 'tall body2 2014', inherit: false, fontSize: 15.0, fontWeight: FontWeight.w700, textBaseline: TextBaseline.alphabetic), bodyText2 : TextStyle(debugLabel: 'tall body1 2014', inherit: false, fontSize: 15.0, fontWeight: FontWeight.w400, textBaseline: TextBaseline.alphabetic),
body1 : TextStyle(debugLabel: 'tall body1 2014', inherit: false, fontSize: 15.0, fontWeight: FontWeight.w400, textBaseline: TextBaseline.alphabetic), subtitle1 : TextStyle(debugLabel: 'tall subhead 2014', inherit: false, fontSize: 17.0, fontWeight: FontWeight.w400, textBaseline: TextBaseline.alphabetic),
caption : TextStyle(debugLabel: 'tall caption 2014', inherit: false, fontSize: 13.0, fontWeight: FontWeight.w400, textBaseline: TextBaseline.alphabetic), subtitle2 : TextStyle(debugLabel: 'tall subtitle 2014', inherit: false, fontSize: 15.0, fontWeight: FontWeight.w500, textBaseline: TextBaseline.alphabetic),
button : TextStyle(debugLabel: 'tall button 2014', inherit: false, fontSize: 15.0, fontWeight: FontWeight.w700, textBaseline: TextBaseline.alphabetic), caption : TextStyle(debugLabel: 'tall caption 2014', inherit: false, fontSize: 13.0, fontWeight: FontWeight.w400, textBaseline: TextBaseline.alphabetic),
subtitle : TextStyle(debugLabel: 'tall subtitle 2014', inherit: false, fontSize: 15.0, fontWeight: FontWeight.w500, textBaseline: TextBaseline.alphabetic), button : TextStyle(debugLabel: 'tall button 2014', inherit: false, fontSize: 15.0, fontWeight: FontWeight.w700, textBaseline: TextBaseline.alphabetic),
overline : TextStyle(debugLabel: 'tall overline 2014', inherit: false, fontSize: 11.0, fontWeight: FontWeight.w400, textBaseline: TextBaseline.alphabetic), overline : TextStyle(debugLabel: 'tall overline 2014', inherit: false, fontSize: 11.0, fontWeight: FontWeight.w400, textBaseline: TextBaseline.alphabetic),
); );
/// Defines text geometry for tall scripts, such as Farsi, Hindi, and Thai. /// Defines text geometry for tall scripts, such as Farsi, Hindi, and Thai.
@ -440,18 +504,18 @@ class Typography extends Diagnosticable {
/// The font sizes, weights, and letter spacings in this version match the /// The font sizes, weights, and letter spacings in this version match the
/// latest [Material Design specification](https://material.io/go/design-typography#typography-styles). /// latest [Material Design specification](https://material.io/go/design-typography#typography-styles).
static const TextTheme tall2018 = TextTheme( static const TextTheme tall2018 = TextTheme(
display4 : TextStyle(debugLabel: 'tall display4 2018', fontSize: 96.0, fontWeight: FontWeight.w400, textBaseline: TextBaseline.alphabetic), headline1 : TextStyle(debugLabel: 'tall headline1 2018', fontSize: 96.0, fontWeight: FontWeight.w400, textBaseline: TextBaseline.alphabetic),
display3 : TextStyle(debugLabel: 'tall display3 2018', fontSize: 60.0, fontWeight: FontWeight.w400, textBaseline: TextBaseline.alphabetic), headline2 : TextStyle(debugLabel: 'tall headline2 2018', fontSize: 60.0, fontWeight: FontWeight.w400, textBaseline: TextBaseline.alphabetic),
display2 : TextStyle(debugLabel: 'tall display2 2018', fontSize: 48.0, fontWeight: FontWeight.w400, textBaseline: TextBaseline.alphabetic), headline3 : TextStyle(debugLabel: 'tall headline3 2018', fontSize: 48.0, fontWeight: FontWeight.w400, textBaseline: TextBaseline.alphabetic),
display1 : TextStyle(debugLabel: 'tall display1 2018', fontSize: 34.0, fontWeight: FontWeight.w400, textBaseline: TextBaseline.alphabetic), headline4 : TextStyle(debugLabel: 'tall headline4 2018', fontSize: 34.0, fontWeight: FontWeight.w400, textBaseline: TextBaseline.alphabetic),
headline : TextStyle(debugLabel: 'tall headline 2018', fontSize: 24.0, fontWeight: FontWeight.w400, textBaseline: TextBaseline.alphabetic), headline5 : TextStyle(debugLabel: 'tall headline5 2018', fontSize: 24.0, fontWeight: FontWeight.w400, textBaseline: TextBaseline.alphabetic),
title : TextStyle(debugLabel: 'tall title 2018', fontSize: 21.0, fontWeight: FontWeight.w700, textBaseline: TextBaseline.alphabetic), headline6 : TextStyle(debugLabel: 'tall headline6 2018', fontSize: 21.0, fontWeight: FontWeight.w700, textBaseline: TextBaseline.alphabetic),
subhead : TextStyle(debugLabel: 'tall subhead 2018', fontSize: 17.0, fontWeight: FontWeight.w400, textBaseline: TextBaseline.alphabetic), bodyText1 : TextStyle(debugLabel: 'tall bodyText1 2018', fontSize: 17.0, fontWeight: FontWeight.w700, textBaseline: TextBaseline.alphabetic),
body2 : TextStyle(debugLabel: 'tall body2 2018', fontSize: 17.0, fontWeight: FontWeight.w700, textBaseline: TextBaseline.alphabetic), bodyText2 : TextStyle(debugLabel: 'tall bodyText2 2018', fontSize: 15.0, fontWeight: FontWeight.w400, textBaseline: TextBaseline.alphabetic),
body1 : TextStyle(debugLabel: 'tall body1 2018', fontSize: 15.0, fontWeight: FontWeight.w400, textBaseline: TextBaseline.alphabetic), subtitle1 : TextStyle(debugLabel: 'tall subtitle1 2018', fontSize: 17.0, fontWeight: FontWeight.w400, textBaseline: TextBaseline.alphabetic),
subtitle2 : TextStyle(debugLabel: 'tall subtitle2 2018', fontSize: 15.0, fontWeight: FontWeight.w500, textBaseline: TextBaseline.alphabetic),
button : TextStyle(debugLabel: 'tall button 2018', fontSize: 15.0, fontWeight: FontWeight.w700, textBaseline: TextBaseline.alphabetic), button : TextStyle(debugLabel: 'tall button 2018', fontSize: 15.0, fontWeight: FontWeight.w700, textBaseline: TextBaseline.alphabetic),
caption : TextStyle(debugLabel: 'tall caption 2018', fontSize: 13.0, fontWeight: FontWeight.w400, textBaseline: TextBaseline.alphabetic), caption : TextStyle(debugLabel: 'tall caption 2018', fontSize: 13.0, fontWeight: FontWeight.w400, textBaseline: TextBaseline.alphabetic),
subtitle : TextStyle(debugLabel: 'tall subtitle 2018', fontSize: 15.0, fontWeight: FontWeight.w500, textBaseline: TextBaseline.alphabetic),
overline : TextStyle(debugLabel: 'tall overline 2018', fontSize: 11.0, fontWeight: FontWeight.w400, textBaseline: TextBaseline.alphabetic), overline : TextStyle(debugLabel: 'tall overline 2018', fontSize: 11.0, fontWeight: FontWeight.w400, textBaseline: TextBaseline.alphabetic),
); );
} }

View File

@ -147,7 +147,7 @@ class _AccountDetailsState extends State<_AccountDetails> with SingleTickerProvi
child: Padding( child: Padding(
padding: const EdgeInsets.symmetric(vertical: 2.0), padding: const EdgeInsets.symmetric(vertical: 2.0),
child: DefaultTextStyle( child: DefaultTextStyle(
style: theme.primaryTextTheme.body2, style: theme.primaryTextTheme.bodyText1,
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
child: widget.accountName, child: widget.accountName,
), ),
@ -159,7 +159,7 @@ class _AccountDetailsState extends State<_AccountDetails> with SingleTickerProvi
child: Padding( child: Padding(
padding: const EdgeInsets.symmetric(vertical: 2.0), padding: const EdgeInsets.symmetric(vertical: 2.0),
child: DefaultTextStyle( child: DefaultTextStyle(
style: theme.primaryTextTheme.body1, style: theme.primaryTextTheme.bodyText2,
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
child: widget.accountEmail, child: widget.accountEmail,
), ),

View File

@ -91,7 +91,7 @@ abstract class KeyboardKey extends Diagnosticable {
/// color: Colors.white, /// color: Colors.white,
/// alignment: Alignment.center, /// alignment: Alignment.center,
/// child: DefaultTextStyle( /// child: DefaultTextStyle(
/// style: textTheme.display1, /// style: textTheme.headline4,
/// child: RawKeyboardListener( /// child: RawKeyboardListener(
/// focusNode: _focusNode, /// focusNode: _focusNode,
/// onKey: _handleKeyEvent, /// onKey: _handleKeyEvent,
@ -2000,7 +2000,7 @@ class LogicalKeyboardKey extends KeyboardKey {
/// color: Colors.white, /// color: Colors.white,
/// alignment: Alignment.center, /// alignment: Alignment.center,
/// child: DefaultTextStyle( /// child: DefaultTextStyle(
/// style: textTheme.display1, /// style: textTheme.headline4,
/// child: RawKeyboardListener( /// child: RawKeyboardListener(
/// focusNode: _focusNode, /// focusNode: _focusNode,
/// onKey: _handleKeyEvent, /// onKey: _handleKeyEvent,

View File

@ -229,7 +229,7 @@ class _ActiveItem implements Comparable<_ActiveItem> {
/// ///
/// @override /// @override
/// Widget build(BuildContext context) { /// Widget build(BuildContext context) {
/// TextStyle textStyle = Theme.of(context).textTheme.display1; /// TextStyle textStyle = Theme.of(context).textTheme.headline4;
/// if (selected) /// if (selected)
/// textStyle = textStyle.copyWith(color: Colors.lightGreenAccent[400]); /// textStyle = textStyle.copyWith(color: Colors.lightGreenAccent[400]);
/// return Padding( /// return Padding(
@ -712,7 +712,7 @@ class AnimatedListState extends State<AnimatedList> with TickerProviderStateMixi
/// child: Center( /// child: Center(
/// child: Text( /// child: Text(
/// 'Item $item', /// 'Item $item',
/// style: Theme.of(context).textTheme.display1, /// style: Theme.of(context).textTheme.headline4,
/// ), /// ),
/// ), /// ),
/// ), /// ),

View File

@ -118,7 +118,7 @@ typedef AnimatedSwitcherLayoutBuilder = Widget Function(Widget currentChild, Lis
/// // child each time the count changes, so that it will begin its animation /// // child each time the count changes, so that it will begin its animation
/// // when the count changes. /// // when the count changes.
/// key: ValueKey<int>(_count), /// key: ValueKey<int>(_count),
/// style: Theme.of(context).textTheme.display1, /// style: Theme.of(context).textTheme.headline4,
/// ), /// ),
/// ), /// ),
/// RaisedButton( /// RaisedButton(

View File

@ -5585,7 +5585,7 @@ class WidgetToRenderBoxAdapter extends LeafRenderObjectWidget {
/// Text('You have pressed or released in this area this many times:'), /// Text('You have pressed or released in this area this many times:'),
/// Text( /// Text(
/// '$_downCounter presses\n$_upCounter releases', /// '$_downCounter presses\n$_upCounter releases',
/// style: Theme.of(context).textTheme.display1, /// style: Theme.of(context).textTheme.headline4,
/// ), /// ),
/// Text( /// Text(
/// 'The cursor is here: (${x.toStringAsFixed(2)}, ${y.toStringAsFixed(2)})', /// 'The cursor is here: (${x.toStringAsFixed(2)}, ${y.toStringAsFixed(2)})',
@ -5836,7 +5836,7 @@ class _PointerListener extends SingleChildRenderObjectWidget {
/// Text('You have entered or exited this box this many times:'), /// Text('You have entered or exited this box this many times:'),
/// Text( /// Text(
/// '$_enterCounter Entries\n$_exitCounter Exits', /// '$_enterCounter Entries\n$_exitCounter Exits',
/// style: Theme.of(context).textTheme.display1, /// style: Theme.of(context).textTheme.headline4,
/// ), /// ),
/// Text( /// Text(
/// 'The cursor is here: (${x.toStringAsFixed(2)}, ${y.toStringAsFixed(2)})', /// 'The cursor is here: (${x.toStringAsFixed(2)}, ${y.toStringAsFixed(2)})',

View File

@ -266,7 +266,7 @@ class DecoratedBox extends SingleChildRenderObjectWidget {
/// ```dart /// ```dart
/// Container( /// Container(
/// constraints: BoxConstraints.expand( /// constraints: BoxConstraints.expand(
/// height: Theme.of(context).textTheme.display1.fontSize * 1.1 + 200.0, /// height: Theme.of(context).textTheme.headline4.fontSize * 1.1 + 200.0,
/// ), /// ),
/// padding: const EdgeInsets.all(8.0), /// padding: const EdgeInsets.all(8.0),
/// color: Colors.blue[600], /// color: Colors.blue[600],
@ -274,7 +274,7 @@ class DecoratedBox extends SingleChildRenderObjectWidget {
/// child: Text('Hello World', /// child: Text('Hello World',
/// style: Theme.of(context) /// style: Theme.of(context)
/// .textTheme /// .textTheme
/// .display1 /// .headline4
/// .copyWith(color: Colors.white)), /// .copyWith(color: Colors.white)),
/// transform: Matrix4.rotationZ(0.1), /// transform: Matrix4.rotationZ(0.1),
/// ) /// )

View File

@ -342,7 +342,7 @@ class FocusAttachment {
/// Widget build(BuildContext context) { /// Widget build(BuildContext context) {
/// final TextTheme textTheme = Theme.of(context).textTheme; /// final TextTheme textTheme = Theme.of(context).textTheme;
/// return DefaultTextStyle( /// return DefaultTextStyle(
/// style: textTheme.display1, /// style: textTheme.headline4,
/// child: ColorfulButton(), /// child: ColorfulButton(),
/// ); /// );
/// } /// }

View File

@ -83,7 +83,7 @@ import 'inherited_notifier.dart';
/// debugLabel: 'Scope', /// debugLabel: 'Scope',
/// autofocus: true, /// autofocus: true,
/// child: DefaultTextStyle( /// child: DefaultTextStyle(
/// style: textTheme.display1, /// style: textTheme.headline4,
/// child: Focus( /// child: Focus(
/// onKey: _handleKeyPress, /// onKey: _handleKeyPress,
/// debugLabel: 'Button', /// debugLabel: 'Button',

View File

@ -663,7 +663,7 @@ class NavigatorObserver {
/// @override /// @override
/// Widget build(BuildContext context) { /// Widget build(BuildContext context) {
/// return DefaultTextStyle( /// return DefaultTextStyle(
/// style: Theme.of(context).textTheme.display1, /// style: Theme.of(context).textTheme.headline4,
/// child: Container( /// child: Container(
/// color: Colors.white, /// color: Colors.white,
/// alignment: Alignment.center, /// alignment: Alignment.center,
@ -677,7 +677,7 @@ class NavigatorObserver {
/// @override /// @override
/// Widget build(BuildContext context) { /// Widget build(BuildContext context) {
/// return DefaultTextStyle( /// return DefaultTextStyle(
/// style: Theme.of(context).textTheme.display1, /// style: Theme.of(context).textTheme.headline4,
/// child: GestureDetector( /// child: GestureDetector(
/// onTap: () { /// onTap: () {
/// // This moves from the personal info page to the credentials page, /// // This moves from the personal info page to the credentials page,
@ -707,7 +707,7 @@ class NavigatorObserver {
/// return GestureDetector( /// return GestureDetector(
/// onTap: onSignupComplete, /// onTap: onSignupComplete,
/// child: DefaultTextStyle( /// child: DefaultTextStyle(
/// style: Theme.of(context).textTheme.display1, /// style: Theme.of(context).textTheme.headline4,
/// child: Container( /// child: Container(
/// color: Colors.pinkAccent, /// color: Colors.pinkAccent,
/// alignment: Alignment.center, /// alignment: Alignment.center,

View File

@ -34,7 +34,7 @@ void main() {
expect(iconTheme.data, const IconThemeData(color: Colors.white)); expect(iconTheme.data, const IconThemeData(color: Colors.white));
expect(actionsIconTheme.data, const IconThemeData(color: Colors.white)); expect(actionsIconTheme.data, const IconThemeData(color: Colors.white));
expect(actionIconText.text.style.color, Colors.white); expect(actionIconText.text.style.color, Colors.white);
expect(text.style, Typography().englishLike.body1.merge(Typography().white.body1)); expect(text.style, Typography.material2014().englishLike.bodyText2.merge(Typography.material2014().white.bodyText2));
}); });
testWidgets('AppBar uses values from AppBarTheme', (WidgetTester tester) async { testWidgets('AppBar uses values from AppBarTheme', (WidgetTester tester) async {
@ -62,7 +62,7 @@ void main() {
expect(iconTheme.data, appBarTheme.iconTheme); expect(iconTheme.data, appBarTheme.iconTheme);
expect(actionsIconTheme.data, appBarTheme.actionsIconTheme); expect(actionsIconTheme.data, appBarTheme.actionsIconTheme);
expect(actionIconText.text.style.color, appBarTheme.actionsIconTheme.color); expect(actionIconText.text.style.color, appBarTheme.actionsIconTheme.color);
expect(text.style, appBarTheme.textTheme.body1); expect(text.style, appBarTheme.textTheme.bodyText2);
}); });
testWidgets('AppBar widget properties take priority over theme', (WidgetTester tester) async { testWidgets('AppBar widget properties take priority over theme', (WidgetTester tester) async {
@ -71,7 +71,7 @@ void main() {
const double elevation = 3.0; const double elevation = 3.0;
const IconThemeData iconThemeData = IconThemeData(color: Colors.green); const IconThemeData iconThemeData = IconThemeData(color: Colors.green);
const IconThemeData actionsIconThemeData = IconThemeData(color: Colors.lightBlue); const IconThemeData actionsIconThemeData = IconThemeData(color: Colors.lightBlue);
const TextTheme textTheme = TextTheme(title: TextStyle(color: Colors.orange), body1: TextStyle(color: Colors.pink)); const TextTheme textTheme = TextTheme(headline6: TextStyle(color: Colors.orange), bodyText2: TextStyle(color: Colors.pink));
final ThemeData themeData = _themeData().copyWith(appBarTheme: _appBarTheme()); final ThemeData themeData = _themeData().copyWith(appBarTheme: _appBarTheme());
@ -102,7 +102,7 @@ void main() {
expect(iconTheme.data, iconThemeData); expect(iconTheme.data, iconThemeData);
expect(actionsIconTheme.data, actionsIconThemeData); expect(actionsIconTheme.data, actionsIconThemeData);
expect(actionIconText.text.style.color, actionsIconThemeData.color); expect(actionIconText.text.style.color, actionsIconThemeData.color);
expect(text.style, textTheme.body1); expect(text.style, textTheme.bodyText2);
}); });
testWidgets('AppBar icon color takes priority over everything', (WidgetTester tester) async { testWidgets('AppBar icon color takes priority over everything', (WidgetTester tester) async {
@ -152,7 +152,7 @@ void main() {
expect(iconTheme.data, appBarTheme.iconTheme); expect(iconTheme.data, appBarTheme.iconTheme);
expect(actionsIconTheme.data, appBarTheme.actionsIconTheme); expect(actionsIconTheme.data, appBarTheme.actionsIconTheme);
expect(actionIconText.text.style.color, appBarTheme.actionsIconTheme.color); expect(actionIconText.text.style.color, appBarTheme.actionsIconTheme.color);
expect(text.style, appBarTheme.textTheme.body1); expect(text.style, appBarTheme.textTheme.bodyText2);
}); });
testWidgets('ThemeData properties are used when no AppBarTheme is set', (WidgetTester tester) async { testWidgets('ThemeData properties are used when no AppBarTheme is set', (WidgetTester tester) async {
@ -179,7 +179,8 @@ void main() {
expect(iconTheme.data, themeData.primaryIconTheme); expect(iconTheme.data, themeData.primaryIconTheme);
expect(actionsIconTheme.data, themeData.primaryIconTheme); expect(actionsIconTheme.data, themeData.primaryIconTheme);
expect(actionIconText.text.style.color, themeData.primaryIconTheme.color); expect(actionIconText.text.style.color, themeData.primaryIconTheme.color);
expect(text.style, Typography().englishLike.body1.merge(Typography().white.body1).merge(themeData.primaryTextTheme.body1)); // Default value for ThemeData.typography is Typography.material2014()
expect(text.style, Typography.material2014().englishLike.bodyText2.merge(Typography.material2014().white.bodyText2).merge(themeData.primaryTextTheme.bodyText2));
}); });
} }
@ -189,7 +190,7 @@ AppBarTheme _appBarTheme() {
const double elevation = 6.0; const double elevation = 6.0;
const IconThemeData iconThemeData = IconThemeData(color: Colors.black); const IconThemeData iconThemeData = IconThemeData(color: Colors.black);
const IconThemeData actionsIconThemeData = IconThemeData(color: Colors.pink); const IconThemeData actionsIconThemeData = IconThemeData(color: Colors.pink);
const TextTheme textTheme = TextTheme(body1: TextStyle(color: Colors.yellow)); const TextTheme textTheme = TextTheme(bodyText2: TextStyle(color: Colors.yellow));
return const AppBarTheme( return const AppBarTheme(
actionsIconTheme: actionsIconThemeData, actionsIconTheme: actionsIconThemeData,
brightness: brightness, brightness: brightness,
@ -205,7 +206,7 @@ ThemeData _themeData() {
primaryColor: Colors.purple, primaryColor: Colors.purple,
brightness: Brightness.dark, brightness: Brightness.dark,
primaryIconTheme: const IconThemeData(color: Colors.green), primaryIconTheme: const IconThemeData(color: Colors.green),
primaryTextTheme: const TextTheme(title: TextStyle(color: Colors.orange), body1: TextStyle(color: Colors.pink)), primaryTextTheme: const TextTheme(headline6: TextStyle(color: Colors.orange), bodyText2: TextStyle(color: Colors.pink)),
); );
} }

View File

@ -67,7 +67,8 @@ void main() {
final Container container = _getContainerFromBanner(tester); final Container container = _getContainerFromBanner(tester);
final RenderParagraph content = _getTextRenderObjectFromDialog(tester, contentText); final RenderParagraph content = _getTextRenderObjectFromDialog(tester, contentText);
expect(container.decoration, const BoxDecoration(color: Color(0xffffffff))); expect(container.decoration, const BoxDecoration(color: Color(0xffffffff)));
expect(content.text.style, Typography().englishLike.body1.merge(Typography().black.body1)); // Default value for ThemeData.typography is Typography.material2014()
expect(content.text.style, Typography.material2014().englishLike.bodyText2.merge(Typography.material2014().black.bodyText2));
}); });
testWidgets('MaterialBanner uses values from MaterialBannerThemeData', (WidgetTester tester) async { testWidgets('MaterialBanner uses values from MaterialBannerThemeData', (WidgetTester tester) async {

View File

@ -169,7 +169,7 @@ void main() {
testWidgets('ChipThemeData generates correct opacities for defaults', (WidgetTester tester) async { testWidgets('ChipThemeData generates correct opacities for defaults', (WidgetTester tester) async {
const Color customColor1 = Color(0xcafefeed); const Color customColor1 = Color(0xcafefeed);
const Color customColor2 = Color(0xdeadbeef); const Color customColor2 = Color(0xdeadbeef);
final TextStyle customStyle = ThemeData.fallback().textTheme.body2.copyWith(color: customColor2); final TextStyle customStyle = ThemeData.fallback().textTheme.bodyText1.copyWith(color: customColor2);
final ChipThemeData lightTheme = ChipThemeData.fromDefaults( final ChipThemeData lightTheme = ChipThemeData.fromDefaults(
secondaryColor: customColor1, secondaryColor: customColor1,
@ -230,7 +230,7 @@ void main() {
final ChipThemeData chipThemeBlack = ChipThemeData.fromDefaults( final ChipThemeData chipThemeBlack = ChipThemeData.fromDefaults(
secondaryColor: Colors.black, secondaryColor: Colors.black,
brightness: Brightness.dark, brightness: Brightness.dark,
labelStyle: ThemeData.fallback().textTheme.body2.copyWith(color: Colors.black), labelStyle: ThemeData.fallback().textTheme.bodyText1.copyWith(color: Colors.black),
).copyWith( ).copyWith(
elevation: 1.0, elevation: 1.0,
pressElevation: 4.0, pressElevation: 4.0,
@ -241,7 +241,7 @@ void main() {
final ChipThemeData chipThemeWhite = ChipThemeData.fromDefaults( final ChipThemeData chipThemeWhite = ChipThemeData.fromDefaults(
secondaryColor: Colors.white, secondaryColor: Colors.white,
brightness: Brightness.light, brightness: Brightness.light,
labelStyle: ThemeData.fallback().textTheme.body2.copyWith(color: Colors.white), labelStyle: ThemeData.fallback().textTheme.bodyText1.copyWith(color: Colors.white),
).copyWith( ).copyWith(
padding: const EdgeInsets.all(2.0), padding: const EdgeInsets.all(2.0),
labelPadding: const EdgeInsets.only(top: 8.0, bottom: 8.0), labelPadding: const EdgeInsets.only(top: 8.0, bottom: 8.0),

View File

@ -117,7 +117,7 @@ void main() {
expect(decoration.color, equals(theme.primaryColorLight)); expect(decoration.color, equals(theme.primaryColorLight));
final RenderParagraph paragraph = tester.renderObject(find.text('Z')); final RenderParagraph paragraph = tester.renderObject(find.text('Z'));
expect(paragraph.text.style.color, equals(theme.primaryTextTheme.title.color)); expect(paragraph.text.style.color, equals(theme.primaryTextTheme.headline6.color));
}); });
testWidgets('CircleAvatar with dark theme', (WidgetTester tester) async { testWidgets('CircleAvatar with dark theme', (WidgetTester tester) async {
@ -142,7 +142,7 @@ void main() {
expect(decoration.color, equals(theme.primaryColorDark)); expect(decoration.color, equals(theme.primaryColorDark));
final RenderParagraph paragraph = tester.renderObject(find.text('Z')); final RenderParagraph paragraph = tester.renderObject(find.text('Z'));
expect(paragraph.text.style.color, equals(theme.primaryTextTheme.title.color)); expect(paragraph.text.style.color, equals(theme.primaryTextTheme.headline6.color));
}); });
testWidgets('CircleAvatar text does not expand with textScaleFactor', (WidgetTester tester) async { testWidgets('CircleAvatar text does not expand with textScaleFactor', (WidgetTester tester) async {

View File

@ -175,7 +175,7 @@ void main() {
title: Text(titleText), title: Text(titleText),
actions: <Widget>[ ], actions: <Widget>[ ],
); );
final ThemeData theme = ThemeData(textTheme: const TextTheme(title: titleTextStyle)); final ThemeData theme = ThemeData(textTheme: const TextTheme(headline6: titleTextStyle));
await tester.pumpWidget(_appWithAlertDialog(tester, dialog, theme: theme)); await tester.pumpWidget(_appWithAlertDialog(tester, dialog, theme: theme));
await tester.tap(find.text('X')); await tester.tap(find.text('X'));
@ -226,7 +226,7 @@ void main() {
content: Text(contentText), content: Text(contentText),
actions: <Widget>[ ], actions: <Widget>[ ],
); );
final ThemeData theme = ThemeData(textTheme: const TextTheme(subhead: contentTextStyle)); final ThemeData theme = ThemeData(textTheme: const TextTheme(subtitle1: contentTextStyle));
await tester.pumpWidget(_appWithAlertDialog(tester, dialog, theme: theme)); await tester.pumpWidget(_appWithAlertDialog(tester, dialog, theme: theme));
await tester.tap(find.text('X')); await tester.tap(find.text('X'));

View File

@ -168,7 +168,7 @@ void main() {
platform: TargetPlatform.iOS, platform: TargetPlatform.iOS,
accentColor: _accentColor, accentColor: _accentColor,
unselectedWidgetColor: _unselectedWidgetColor, unselectedWidgetColor: _unselectedWidgetColor,
textTheme: const TextTheme(subhead: TextStyle(color: _headerColor)), textTheme: const TextTheme(subtitle1: TextStyle(color: _headerColor)),
), ),
home: Material( home: Material(
child: SingleChildScrollView( child: SingleChildScrollView(

View File

@ -3613,7 +3613,7 @@ void main() {
testWidgets('uses alphabetic baseline for CJK layout', (WidgetTester tester) async { testWidgets('uses alphabetic baseline for CJK layout', (WidgetTester tester) async {
await tester.binding.setLocale('zh', 'CN'); await tester.binding.setLocale('zh', 'CN');
final Typography typography = Typography(); final Typography typography = Typography.material2018();
final FocusNode focusNode = FocusNode(); final FocusNode focusNode = FocusNode();
final TextEditingController controller = TextEditingController(); final TextEditingController controller = TextEditingController();

View File

@ -910,7 +910,7 @@ void main() {
textDirection: textDirection, textDirection: textDirection,
child: PopupMenuTheme( child: PopupMenuTheme(
data: PopupMenuTheme.of(context).copyWith( data: PopupMenuTheme.of(context).copyWith(
textStyle: Theme.of(context).textTheme.subhead.copyWith(fontSize: fontSize), textStyle: Theme.of(context).textTheme.subtitle1.copyWith(fontSize: fontSize),
), ),
child: child, child: child,
), ),

Some files were not shown because too many files have changed in this diff Show More