diff --git a/dev/benchmarks/complex_layout/lib/main.dart b/dev/benchmarks/complex_layout/lib/main.dart index 8d0ae22ffb1..4496bdd56a2 100644 --- a/dev/benchmarks/complex_layout/lib/main.dart +++ b/dev/benchmarks/complex_layout/lib/main.dart @@ -363,7 +363,7 @@ class UserHeader extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.stretch, children: [ RichText(text: TextSpan( - style: Theme.of(context).textTheme.body1, + style: Theme.of(context).textTheme.bodyText2, children: [ TextSpan(text: userName, style: const TextStyle(fontWeight: FontWeight.bold)), const TextSpan(text: ' shared a new '), @@ -462,8 +462,8 @@ class ItemImageBox extends StatelessWidget { child: Column( crossAxisAlignment: CrossAxisAlignment.stretch, children: [ - Text('Artisans of Southern India', style: Theme.of(context).textTheme.body2), - Text('Silk Spinners', style: Theme.of(context).textTheme.body1), + Text('Artisans of Southern India', style: Theme.of(context).textTheme.bodyText1), + Text('Silk Spinners', style: Theme.of(context).textTheme.bodyText2), Text('Sivaganga, Tamil Nadu', style: Theme.of(context).textTheme.caption), ], ), @@ -506,7 +506,7 @@ class ItemGalleryBox extends StatelessWidget { child: Container( color: Theme.of(context).primaryColor, 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)), ), ), ), diff --git a/dev/integration_tests/android_splash_screens/splash_screen_kitchen_sink/lib/main.dart b/dev/integration_tests/android_splash_screens/splash_screen_kitchen_sink/lib/main.dart index 88e43c5fae4..cc21f207528 100644 --- a/dev/integration_tests/android_splash_screens/splash_screen_kitchen_sink/lib/main.dart +++ b/dev/integration_tests/android_splash_screens/splash_screen_kitchen_sink/lib/main.dart @@ -100,7 +100,7 @@ class _MyHomePageState extends State { ), Text( '$_counter', - style: Theme.of(context).textTheme.display1, + style: Theme.of(context).textTheme.headline4, ), ], ), diff --git a/dev/integration_tests/android_splash_screens/splash_screen_load_rotate/lib/main.dart b/dev/integration_tests/android_splash_screens/splash_screen_load_rotate/lib/main.dart index 1e21f3b2c34..c1d992349a3 100644 --- a/dev/integration_tests/android_splash_screens/splash_screen_load_rotate/lib/main.dart +++ b/dev/integration_tests/android_splash_screens/splash_screen_load_rotate/lib/main.dart @@ -100,7 +100,7 @@ class _MyHomePageState extends State { ), Text( '$_counter', - style: Theme.of(context).textTheme.display1, + style: Theme.of(context).textTheme.headline4, ), ], ), diff --git a/dev/integration_tests/android_splash_screens/splash_screen_trans_rotate/lib/main.dart b/dev/integration_tests/android_splash_screens/splash_screen_trans_rotate/lib/main.dart index 1e21f3b2c34..c1d992349a3 100644 --- a/dev/integration_tests/android_splash_screens/splash_screen_trans_rotate/lib/main.dart +++ b/dev/integration_tests/android_splash_screens/splash_screen_trans_rotate/lib/main.dart @@ -100,7 +100,7 @@ class _MyHomePageState extends State { ), Text( '$_counter', - style: Theme.of(context).textTheme.display1, + style: Theme.of(context).textTheme.headline4, ), ], ), diff --git a/dev/manual_tests/lib/actions.dart b/dev/manual_tests/lib/actions.dart index 2663b54c5ac..1ee61508a80 100644 --- a/dev/manual_tests/lib/actions.dart +++ b/dev/manual_tests/lib/actions.dart @@ -446,7 +446,7 @@ class _FocusDemoState extends State { debugLabel: 'Scope', autofocus: true, child: DefaultTextStyle( - style: textTheme.display1, + style: textTheme.headline4, child: Scaffold( appBar: AppBar( title: const Text('Actions Demo'), diff --git a/dev/manual_tests/lib/card_collection.dart b/dev/manual_tests/lib/card_collection.dart index c8288a0666a..802c90ea2ab 100644 --- a/dev/manual_tests/lib/card_collection.dart +++ b/dev/manual_tests/lib/card_collection.dart @@ -240,7 +240,7 @@ class CardCollectionState extends State { padding: const EdgeInsets.only(left: 72.0), height: 128.0, 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 { rightArrowIcon = Opacity(opacity: 0.1, child: rightArrowIcon); 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 // moves to the left or right. The Positioned widget ensures that the diff --git a/dev/manual_tests/lib/drag_and_drop.dart b/dev/manual_tests/lib/drag_and_drop.dart index b5095a450b7..cf0cdf06604 100644 --- a/dev/manual_tests/lib/drag_and_drop.dart +++ b/dev/manual_tests/lib/drag_and_drop.dart @@ -100,7 +100,7 @@ class ExampleDragSource extends StatelessWidget { size *= kHeavyMultiplier; final Widget contents = DefaultTextStyle( - style: Theme.of(context).textTheme.body1, + style: Theme.of(context).textTheme.bodyText2, textAlign: TextAlign.center, child: Dot( color: color, @@ -188,7 +188,7 @@ class MovableBall extends StatelessWidget { @override Widget build(BuildContext context) { final Widget ball = DefaultTextStyle( - style: Theme.of(context).primaryTextTheme.body1, + style: Theme.of(context).primaryTextTheme.bodyText2, textAlign: TextAlign.center, child: Dot( key: kBallKey, diff --git a/dev/manual_tests/lib/focus.dart b/dev/manual_tests/lib/focus.dart index baf4a1d9a2f..361988e7ff9 100644 --- a/dev/manual_tests/lib/focus.dart +++ b/dev/manual_tests/lib/focus.dart @@ -149,7 +149,7 @@ class _FocusDemoState extends State { onKey: _handleKeyPress, autofocus: true, child: DefaultTextStyle( - style: textTheme.display1, + style: textTheme.headline4, child: Scaffold( appBar: AppBar( title: const Text('Focus Demo'), diff --git a/dev/manual_tests/lib/hover.dart b/dev/manual_tests/lib/hover.dart index d4c045fbac2..a63158060b2 100644 --- a/dev/manual_tests/lib/hover.dart +++ b/dev/manual_tests/lib/hover.dart @@ -56,7 +56,7 @@ class _HoverDemoState extends State { final TextTheme textTheme = Theme.of(context).textTheme; return DefaultTextStyle( - style: textTheme.display1, + style: textTheme.headline4, child: Scaffold( appBar: AppBar( title: const Text('Hover Demo'), diff --git a/dev/manual_tests/lib/raw_keyboard.dart b/dev/manual_tests/lib/raw_keyboard.dart index 5f78ca378b5..da44df07527 100644 --- a/dev/manual_tests/lib/raw_keyboard.dart +++ b/dev/manual_tests/lib/raw_keyboard.dart @@ -79,12 +79,12 @@ class _HardwareKeyDemoState extends State { onTap: () { _focusNode.requestFocus(); }, - child: Text('Tap to focus', style: textTheme.display1), + child: Text('Tap to focus', style: textTheme.headline4), ); } if (_event == null) { - return Text('Press a key', style: textTheme.display1); + return Text('Press a key', style: textTheme.headline4); } final RawKeyEventData data = _event.data; @@ -137,7 +137,7 @@ class _HardwareKeyDemoState extends State { } } return DefaultTextStyle( - style: textTheme.subhead, + style: textTheme.subtitle1, child: Column( mainAxisAlignment: MainAxisAlignment.center, children: dataText, diff --git a/dev/tools/gen_keycodes/data/keyboard_key.tmpl b/dev/tools/gen_keycodes/data/keyboard_key.tmpl index 689d41195df..740ea90e8ea 100644 --- a/dev/tools/gen_keycodes/data/keyboard_key.tmpl +++ b/dev/tools/gen_keycodes/data/keyboard_key.tmpl @@ -91,7 +91,7 @@ abstract class KeyboardKey extends Diagnosticable { /// color: Colors.white, /// alignment: Alignment.center, /// child: DefaultTextStyle( -/// style: textTheme.display1, +/// style: textTheme.headline4, /// child: RawKeyboardListener( /// focusNode: _focusNode, /// onKey: _handleKeyEvent, @@ -371,7 +371,7 @@ class LogicalKeyboardKey extends KeyboardKey { /// color: Colors.white, /// alignment: Alignment.center, /// child: DefaultTextStyle( -/// style: textTheme.display1, +/// style: textTheme.headline4, /// child: RawKeyboardListener( /// focusNode: _focusNode, /// onKey: _handleKeyEvent, diff --git a/examples/catalog/lib/animated_list.dart b/examples/catalog/lib/animated_list.dart index 6f09d9b6f19..4a2a29254db 100644 --- a/examples/catalog/lib/animated_list.dart +++ b/examples/catalog/lib/animated_list.dart @@ -170,7 +170,7 @@ class CardItem extends StatelessWidget { @override Widget build(BuildContext context) { - TextStyle textStyle = Theme.of(context).textTheme.display1; + TextStyle textStyle = Theme.of(context).textTheme.headline4; if (selected) textStyle = textStyle.copyWith(color: Colors.lightGreenAccent[400]); return Padding( diff --git a/examples/catalog/lib/app_bar_bottom.dart b/examples/catalog/lib/app_bar_bottom.dart index 57b359c6790..1435b505940 100644 --- a/examples/catalog/lib/app_bar_bottom.dart +++ b/examples/catalog/lib/app_bar_bottom.dart @@ -97,7 +97,7 @@ class ChoiceCard extends StatelessWidget { @override Widget build(BuildContext context) { - final TextStyle textStyle = Theme.of(context).textTheme.display1; + final TextStyle textStyle = Theme.of(context).textTheme.headline4; return Card( color: Colors.white, child: Center( diff --git a/examples/catalog/lib/basic_app_bar.dart b/examples/catalog/lib/basic_app_bar.dart index 790e8927b31..9c4f8ffeeac 100644 --- a/examples/catalog/lib/basic_app_bar.dart +++ b/examples/catalog/lib/basic_app_bar.dart @@ -78,7 +78,7 @@ class ChoiceCard extends StatelessWidget { @override Widget build(BuildContext context) { - final TextStyle textStyle = Theme.of(context).textTheme.display1; + final TextStyle textStyle = Theme.of(context).textTheme.headline4; return Card( color: Colors.white, child: Center( diff --git a/examples/catalog/lib/tabbed_app_bar.dart b/examples/catalog/lib/tabbed_app_bar.dart index 5bfad8c5189..f5890a1d9cb 100644 --- a/examples/catalog/lib/tabbed_app_bar.dart +++ b/examples/catalog/lib/tabbed_app_bar.dart @@ -59,7 +59,7 @@ class ChoiceCard extends StatelessWidget { @override Widget build(BuildContext context) { - final TextStyle textStyle = Theme.of(context).textTheme.display1; + final TextStyle textStyle = Theme.of(context).textTheme.headline4; return Card( color: Colors.white, child: Center( diff --git a/examples/flutter_gallery/lib/demo/colors_demo.dart b/examples/flutter_gallery/lib/demo/colors_demo.dart index 43d1c5827d0..26a966cfb0f 100644 --- a/examples/flutter_gallery/lib/demo/colors_demo.dart +++ b/examples/flutter_gallery/lib/demo/colors_demo.dart @@ -97,8 +97,8 @@ class PaletteTabView extends StatelessWidget { @override Widget build(BuildContext context) { final TextTheme textTheme = Theme.of(context).textTheme; - final TextStyle whiteTextStyle = textTheme.body1.copyWith(color: Colors.white); - final TextStyle blackTextStyle = textTheme.body1.copyWith(color: Colors.black); + final TextStyle whiteTextStyle = textTheme.bodyText2.copyWith(color: Colors.white); + final TextStyle blackTextStyle = textTheme.bodyText2.copyWith(color: Colors.black); return Scrollbar( child: ListView( itemExtent: kColorItemHeight, diff --git a/examples/flutter_gallery/lib/demo/contacts_demo.dart b/examples/flutter_gallery/lib/demo/contacts_demo.dart index e3552e14c9d..ccf3ebf9a6d 100644 --- a/examples/flutter_gallery/lib/demo/contacts_demo.dart +++ b/examples/flutter_gallery/lib/demo/contacts_demo.dart @@ -20,7 +20,7 @@ class _ContactCategory extends StatelessWidget { border: Border(bottom: BorderSide(color: themeData.dividerColor)) ), child: DefaultTextStyle( - style: Theme.of(context).textTheme.subhead, + style: Theme.of(context).textTheme.subtitle1, child: SafeArea( top: false, bottom: false, diff --git a/examples/flutter_gallery/lib/demo/fortnightly/fortnightly.dart b/examples/flutter_gallery/lib/demo/fortnightly/fortnightly.dart index 3a5bbe2aaa7..18b165e0081 100644 --- a/examples/flutter_gallery/lib/demo/fortnightly/fortnightly.dart +++ b/examples/flutter_gallery/lib/demo/fortnightly/fortnightly.dart @@ -115,8 +115,8 @@ class FruitPage extends StatelessWidget { ), Text( ' ¬ ', - // TODO(larche): Replace textTheme.display3.color with a ColorScheme value when known. - style: textTheme.overline.apply(color: textTheme.display3.color), + // TODO(larche): Replace textTheme.headline2.color with a ColorScheme value when known. + style: textTheme.overline.apply(color: textTheme.headline2.color), ), Text( 'CULTURE', @@ -127,13 +127,13 @@ class FruitPage extends StatelessWidget { const SizedBox(height: 10), Text( 'Quince for Wisdom, Persimmon for Luck, Pomegranate for Love', - style: textTheme.display1, + style: textTheme.headline4, ), const SizedBox(height: 10), Text( 'How these crazy fruits sweetened our hearts, relationships, ' 'and puffed pastries', - style: textTheme.body1, + style: textTheme.bodyText2, ), Padding( padding: const EdgeInsets.symmetric(vertical: 16), @@ -149,7 +149,7 @@ class FruitPage extends StatelessWidget { const SizedBox(width: 12), Text( 'by', - style: textTheme.display3, + style: textTheme.headline2, ), const SizedBox(width: 4), const Text( @@ -166,7 +166,7 @@ class FruitPage extends StatelessWidget { ), Text( '$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.copyWith( - display1: base.display1.copyWith( + headline4: base.headline4.copyWith( fontFamily: 'Merriweather', fontStyle: FontStyle.italic, fontSize: 28, @@ -202,21 +202,21 @@ TextTheme _buildTextTheme(TextTheme base) { color: Colors.black, height: .88, ), - display3: base.display3.copyWith( + headline2: base.headline2.copyWith( fontFamily: 'LibreFranklin', fontSize: 18, fontWeight: FontWeight.w500, color: Colors.black.withAlpha(153), ), - headline: base.headline.copyWith(fontWeight: FontWeight.w500), - body1: base.body1.copyWith( + headline5: base.headline5.copyWith(fontWeight: FontWeight.w500), + bodyText2: base.bodyText2.copyWith( fontFamily: 'Merriweather', fontSize: 14, fontWeight: FontWeight.w300, color: const Color(0xFF666666), height: 1.11, ), - body2: base.body2.copyWith( + bodyText1: base.bodyText1.copyWith( fontFamily: 'Merriweather', fontSize: 16, fontWeight: FontWeight.w300, diff --git a/examples/flutter_gallery/lib/demo/material/backdrop_demo.dart b/examples/flutter_gallery/lib/demo/material/backdrop_demo.dart index 11a7bfb8b5d..d03f6731e7d 100644 --- a/examples/flutter_gallery/lib/demo/material/backdrop_demo.dart +++ b/examples/flutter_gallery/lib/demo/material/backdrop_demo.dart @@ -185,7 +185,7 @@ class BackdropPanel extends StatelessWidget { padding: const EdgeInsetsDirectional.only(start: 16.0), alignment: AlignmentDirectional.centerStart, child: DefaultTextStyle( - style: theme.textTheme.subhead, + style: theme.textTheme.subtitle1, child: Tooltip( message: 'Tap to dismiss', child: title, @@ -212,7 +212,7 @@ class BackdropTitle extends AnimatedWidget { Widget build(BuildContext context) { final Animation animation = listenable as Animation; return DefaultTextStyle( - style: Theme.of(context).primaryTextTheme.title, + style: Theme.of(context).primaryTextTheme.headline6, softWrap: false, overflow: TextOverflow.ellipsis, child: Stack( @@ -359,8 +359,8 @@ class _BackdropDemoState extends State with SingleTickerProviderSt children: [ ListTileTheme( iconColor: theme.primaryIconTheme.color, - textColor: theme.primaryTextTheme.title.color.withOpacity(0.6), - selectedColor: theme.primaryTextTheme.title.color, + textColor: theme.primaryTextTheme.headline6.color.withOpacity(0.6), + selectedColor: theme.primaryTextTheme.headline6.color, child: Padding( padding: const EdgeInsets.symmetric(horizontal: 16.0), child: Column( diff --git a/examples/flutter_gallery/lib/demo/material/bottom_app_bar_demo.dart b/examples/flutter_gallery/lib/demo/material/bottom_app_bar_demo.dart index 9c034fbfe5a..a66f97cdaa2 100644 --- a/examples/flutter_gallery/lib/demo/material/bottom_app_bar_demo.dart +++ b/examples/flutter_gallery/lib/demo/material/bottom_app_bar_demo.dart @@ -253,7 +253,7 @@ class _RadioItem extends StatelessWidget { }, child: Text( value.title, - style: theme.textTheme.subhead, + style: theme.textTheme.subtitle1, ), ), ), @@ -323,7 +323,7 @@ class _Heading extends StatelessWidget { alignment: AlignmentDirectional.centerStart, child: Text( text, - style: theme.textTheme.body1.copyWith( + style: theme.textTheme.bodyText2.copyWith( color: theme.primaryColor, ), ), diff --git a/examples/flutter_gallery/lib/demo/material/cards_demo.dart b/examples/flutter_gallery/lib/demo/material/cards_demo.dart index 593afcd0234..d43cca9ada2 100644 --- a/examples/flutter_gallery/lib/demo/material/cards_demo.dart +++ b/examples/flutter_gallery/lib/demo/material/cards_demo.dart @@ -243,7 +243,7 @@ class SectionTitle extends StatelessWidget { padding: const EdgeInsets.fromLTRB(4.0, 4.0, 4.0, 12.0), child: Align( 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 Widget build(BuildContext context) { final ThemeData theme = Theme.of(context); - final TextStyle titleStyle = theme.textTheme.headline.copyWith(color: Colors.white); - final TextStyle descriptionStyle = theme.textTheme.subhead; + final TextStyle titleStyle = theme.textTheme.headline5.copyWith(color: Colors.white); + final TextStyle descriptionStyle = theme.textTheme.subtitle1; return Column( crossAxisAlignment: CrossAxisAlignment.start, diff --git a/examples/flutter_gallery/lib/demo/material/chip_demo.dart b/examples/flutter_gallery/lib/demo/material/chip_demo.dart index 2ab9f9bc69e..d67cb4dafa0 100644 --- a/examples/flutter_gallery/lib/demo/material/chip_demo.dart +++ b/examples/flutter_gallery/lib/demo/material/chip_demo.dart @@ -291,7 +291,7 @@ class _ChipDemoState extends State { child: Center( child: Text( _createResult(), - style: theme.textTheme.title, + style: theme.textTheme.headline6, ), ), ), diff --git a/examples/flutter_gallery/lib/demo/material/date_and_time_picker_demo.dart b/examples/flutter_gallery/lib/demo/material/date_and_time_picker_demo.dart index c99fef80397..46700e6ebb4 100644 --- a/examples/flutter_gallery/lib/demo/material/date_and_time_picker_demo.dart +++ b/examples/flutter_gallery/lib/demo/material/date_and_time_picker_demo.dart @@ -87,7 +87,7 @@ class _DateTimePicker extends StatelessWidget { @override Widget build(BuildContext context) { - final TextStyle valueStyle = Theme.of(context).textTheme.title; + final TextStyle valueStyle = Theme.of(context).textTheme.headline6; return Row( crossAxisAlignment: CrossAxisAlignment.end, children: [ @@ -149,13 +149,13 @@ class _DateAndTimePickerDemoState extends State { labelText: 'Event name', border: OutlineInputBorder(), ), - style: Theme.of(context).textTheme.display1, + style: Theme.of(context).textTheme.headline4, ), TextField( decoration: const InputDecoration( labelText: 'Location', ), - style: Theme.of(context).textTheme.display1.copyWith(fontSize: 20.0), + style: Theme.of(context).textTheme.headline4.copyWith(fontSize: 20.0), ), _DateTimePicker( labelText: 'From', diff --git a/examples/flutter_gallery/lib/demo/material/dialog_demo.dart b/examples/flutter_gallery/lib/demo/material/dialog_demo.dart index a7eefa2259f..266757e18d4 100644 --- a/examples/flutter_gallery/lib/demo/material/dialog_demo.dart +++ b/examples/flutter_gallery/lib/demo/material/dialog_demo.dart @@ -83,7 +83,7 @@ class DialogDemoState extends State { @override Widget build(BuildContext 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( key: _scaffoldKey, diff --git a/examples/flutter_gallery/lib/demo/material/drawer_demo.dart b/examples/flutter_gallery/lib/demo/material/drawer_demo.dart index 3efeb421987..c082cb8c3eb 100644 --- a/examples/flutter_gallery/lib/demo/material/drawer_demo.dart +++ b/examples/flutter_gallery/lib/demo/material/drawer_demo.dart @@ -234,7 +234,7 @@ class _DrawerDemoState extends State with TickerProviderStateMixin { Padding( padding: const EdgeInsets.only(top: 8.0), child: Text('Tap here to open the drawer', - style: Theme.of(context).textTheme.subhead, + style: Theme.of(context).textTheme.subtitle1, ), ), ], diff --git a/examples/flutter_gallery/lib/demo/material/expansion_panels_demo.dart b/examples/flutter_gallery/lib/demo/material/expansion_panels_demo.dart index 1b31f0d6c6c..88a21f33645 100644 --- a/examples/flutter_gallery/lib/demo/material/expansion_panels_demo.dart +++ b/examples/flutter_gallery/lib/demo/material/expansion_panels_demo.dart @@ -57,7 +57,7 @@ class DualHeaderWithHint extends StatelessWidget { alignment: Alignment.centerLeft, child: Text( name, - style: textTheme.body1.copyWith(fontSize: 15.0), + style: textTheme.bodyText2.copyWith(fontSize: 15.0), ), ), ), diff --git a/examples/flutter_gallery/lib/demo/material/full_screen_dialog_demo.dart b/examples/flutter_gallery/lib/demo/material/full_screen_dialog_demo.dart index fc3ac599987..a3a6eeb54e6 100644 --- a/examples/flutter_gallery/lib/demo/material/full_screen_dialog_demo.dart +++ b/examples/flutter_gallery/lib/demo/material/full_screen_dialog_demo.dart @@ -32,7 +32,7 @@ class DateTimeItem extends StatelessWidget { final ThemeData theme = Theme.of(context); return DefaultTextStyle( - style: theme.textTheme.subhead, + style: theme.textTheme.subtitle1, child: Row( children: [ Expanded( @@ -115,7 +115,7 @@ class FullScreenDialogDemoState extends State { return true; 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( context: context, @@ -153,7 +153,7 @@ class FullScreenDialogDemoState extends State { title: Text(_hasName ? _eventName : 'Event Name TBD'), actions: [ FlatButton( - child: Text('SAVE', style: theme.textTheme.body1.copyWith(color: Colors.white)), + child: Text('SAVE', style: theme.textTheme.bodyText2.copyWith(color: Colors.white)), onPressed: () { Navigator.pop(context, DismissDialogAction.save); }, @@ -174,7 +174,7 @@ class FullScreenDialogDemoState extends State { labelText: 'Event name', filled: true, ), - style: theme.textTheme.headline, + style: theme.textTheme.headline5, onChanged: (String value) { setState(() { _hasName = value.isNotEmpty; diff --git a/examples/flutter_gallery/lib/demo/material/icons_demo.dart b/examples/flutter_gallery/lib/demo/material/icons_demo.dart index 7b9d457378e..b5d43fa4e20 100644 --- a/examples/flutter_gallery/lib/demo/material/icons_demo.dart +++ b/examples/flutter_gallery/lib/demo/material/icons_demo.dart @@ -109,7 +109,7 @@ class _IconsDemoCard extends StatelessWidget { @override Widget build(BuildContext 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( child: DefaultTextStyle( style: textStyle, diff --git a/examples/flutter_gallery/lib/demo/material/progress_indicator_demo.dart b/examples/flutter_gallery/lib/demo/material/progress_indicator_demo.dart index ad19f1739ee..1c4a2f4dc1e 100644 --- a/examples/flutter_gallery/lib/demo/material/progress_indicator_demo.dart +++ b/examples/flutter_gallery/lib/demo/material/progress_indicator_demo.dart @@ -109,7 +109,7 @@ class _ProgressIndicatorDemoState extends State with Sing body: Center( child: SingleChildScrollView( child: DefaultTextStyle( - style: Theme.of(context).textTheme.title, + style: Theme.of(context).textTheme.headline6, child: GestureDetector( onTap: _handleTap, behavior: HitTestBehavior.opaque, diff --git a/examples/flutter_gallery/lib/demo/material/reorderable_list_demo.dart b/examples/flutter_gallery/lib/demo/material/reorderable_list_demo.dart index b04a49359e4..34917c50750 100644 --- a/examples/flutter_gallery/lib/demo/material/reorderable_list_demo.dart +++ b/examples/flutter_gallery/lib/demo/material/reorderable_list_demo.dart @@ -207,7 +207,7 @@ class _ListDemoState extends State { header: _itemType != _ReorderableListType.threeLine ? Padding( 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, onReorder: _onReorder, reverse: _reverse, diff --git a/examples/flutter_gallery/lib/demo/material/search_demo.dart b/examples/flutter_gallery/lib/demo/material/search_demo.dart index 583d3da8529..cba1512c8bb 100644 --- a/examples/flutter_gallery/lib/demo/material/search_demo.dart +++ b/examples/flutter_gallery/lib/demo/material/search_demo.dart @@ -247,7 +247,7 @@ class _ResultCard extends StatelessWidget { Text(title), Text( '$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( text: TextSpan( text: suggestion.substring(0, query.length), - style: theme.textTheme.subhead.copyWith(fontWeight: FontWeight.bold), + style: theme.textTheme.subtitle1.copyWith(fontWeight: FontWeight.bold), children: [ TextSpan( text: suggestion.substring(query.length), - style: theme.textTheme.subhead, + style: theme.textTheme.subtitle1, ), ], ), diff --git a/examples/flutter_gallery/lib/demo/material/slider_demo.dart b/examples/flutter_gallery/lib/demo/material/slider_demo.dart index 542436a8a96..25ece5b356e 100644 --- a/examples/flutter_gallery/lib/demo/material/slider_demo.dart +++ b/examples/flutter_gallery/lib/demo/material/slider_demo.dart @@ -320,7 +320,7 @@ class _SlidersState extends State<_Sliders> { valueIndicatorColor: Colors.deepPurpleAccent, thumbShape: _CustomThumbShape(), valueIndicatorShape: _CustomValueIndicatorShape(), - valueIndicatorTextStyle: theme.accentTextTheme.body2.copyWith(color: theme.colorScheme.onSurface), + valueIndicatorTextStyle: theme.accentTextTheme.bodyText1.copyWith(color: theme.colorScheme.onSurface), ), child: Slider( value: _discreteCustomValue, diff --git a/examples/flutter_gallery/lib/demo/material/tabs_demo.dart b/examples/flutter_gallery/lib/demo/material/tabs_demo.dart index d0c005fd1ac..9cef2c057e2 100644 --- a/examples/flutter_gallery/lib/demo/material/tabs_demo.dart +++ b/examples/flutter_gallery/lib/demo/material/tabs_demo.dart @@ -127,7 +127,7 @@ class _CardDataItem extends StatelessWidget { Center( child: Text( data.title, - style: Theme.of(context).textTheme.title, + style: Theme.of(context).textTheme.headline6, ), ), ], diff --git a/examples/flutter_gallery/lib/demo/material/tabs_fab_demo.dart b/examples/flutter_gallery/lib/demo/material/tabs_fab_demo.dart index 3373a4f9837..916c09e688e 100644 --- a/examples/flutter_gallery/lib/demo/material/tabs_fab_demo.dart +++ b/examples/flutter_gallery/lib/demo/material/tabs_fab_demo.dart @@ -76,7 +76,7 @@ class _TabsFabDemoState extends State with SingleTickerProviderStat ), child: Padding( padding: const EdgeInsets.all(32.0), - child: Text(_explanatoryText, style: Theme.of(context).textTheme.subhead), + child: Text(_explanatoryText, style: Theme.of(context).textTheme.subtitle1), ), ); }); diff --git a/examples/flutter_gallery/lib/demo/material/tooltip_demo.dart b/examples/flutter_gallery/lib/demo/material/tooltip_demo.dart index 9184fb260ff..e7ce5170f0d 100644 --- a/examples/flutter_gallery/lib/demo/material/tooltip_demo.dart +++ b/examples/flutter_gallery/lib/demo/material/tooltip_demo.dart @@ -30,10 +30,10 @@ class TooltipDemo extends StatelessWidget { bottom: false, child: ListView( children: [ - Text(_introText, style: theme.textTheme.subhead), + Text(_introText, style: theme.textTheme.subtitle1), Row( children: [ - Text('Long press the ', style: theme.textTheme.subhead), + Text('Long press the ', style: theme.textTheme.subtitle1), Tooltip( message: 'call icon', child: Icon( @@ -42,7 +42,7 @@ class TooltipDemo extends StatelessWidget { color: theme.iconTheme.color, ), ), - Text(' icon.', style: theme.textTheme.subhead), + Text(' icon.', style: theme.textTheme.subtitle1), ], ), Center( diff --git a/examples/flutter_gallery/lib/demo/shrine/app.dart b/examples/flutter_gallery/lib/demo/shrine/app.dart index bb6768cb60b..9265c28cd93 100644 --- a/examples/flutter_gallery/lib/demo/shrine/app.dart +++ b/examples/flutter_gallery/lib/demo/shrine/app.dart @@ -99,10 +99,10 @@ ThemeData _buildShrineTheme() { TextTheme _buildShrineTextTheme(TextTheme base) { return base.copyWith( - headline: base.headline.copyWith(fontWeight: FontWeight.w500), - title: base.title.copyWith(fontSize: 18.0), + headline5: base.headline5.copyWith(fontWeight: FontWeight.w500), + headline6: base.headline6.copyWith(fontSize: 18.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), ).apply( fontFamily: 'Raleway', diff --git a/examples/flutter_gallery/lib/demo/shrine/backdrop.dart b/examples/flutter_gallery/lib/demo/shrine/backdrop.dart index 66b2d861c3a..4e85d652422 100644 --- a/examples/flutter_gallery/lib/demo/shrine/backdrop.dart +++ b/examples/flutter_gallery/lib/demo/shrine/backdrop.dart @@ -131,7 +131,7 @@ class _BackdropTitle extends AnimatedWidget { ); return DefaultTextStyle( - style: Theme.of(context).primaryTextTheme.title, + style: Theme.of(context).primaryTextTheme.headline6, softWrap: false, overflow: TextOverflow.ellipsis, child: Row(children: [ diff --git a/examples/flutter_gallery/lib/demo/shrine/category_menu_page.dart b/examples/flutter_gallery/lib/demo/shrine/category_menu_page.dart index 02b80d7c07f..da08a808260 100644 --- a/examples/flutter_gallery/lib/demo/shrine/category_menu_page.dart +++ b/examples/flutter_gallery/lib/demo/shrine/category_menu_page.dart @@ -35,7 +35,7 @@ class CategoryMenuPage extends StatelessWidget { const SizedBox(height: 16.0), Text( categoryString, - style: theme.textTheme.body2, + style: theme.textTheme.bodyText1, textAlign: TextAlign.center, ), const SizedBox(height: 14.0), @@ -50,7 +50,7 @@ class CategoryMenuPage extends StatelessWidget { padding: const EdgeInsets.symmetric(vertical: 16.0), child: Text( categoryString, - style: theme.textTheme.body2.copyWith( + style: theme.textTheme.bodyText1.copyWith( color: kShrineBrown900.withAlpha(153) ), textAlign: TextAlign.center, diff --git a/examples/flutter_gallery/lib/demo/shrine/login.dart b/examples/flutter_gallery/lib/demo/shrine/login.dart index aafffb62066..ea8c0cfe669 100644 --- a/examples/flutter_gallery/lib/demo/shrine/login.dart +++ b/examples/flutter_gallery/lib/demo/shrine/login.dart @@ -50,7 +50,7 @@ class _LoginPageState extends State { const SizedBox(height: 16.0), Text( 'SHRINE', - style: Theme.of(context).textTheme.headline, + style: Theme.of(context).textTheme.headline5, ), ], ), diff --git a/examples/flutter_gallery/lib/demo/shrine/shopping_cart.dart b/examples/flutter_gallery/lib/demo/shrine/shopping_cart.dart index c5db16ae1d8..ec05a431caa 100644 --- a/examples/flutter_gallery/lib/demo/shrine/shopping_cart.dart +++ b/examples/flutter_gallery/lib/demo/shrine/shopping_cart.dart @@ -57,7 +57,7 @@ class _ShoppingCartPageState extends State { ), Text( 'CART', - style: localTheme.textTheme.subhead.copyWith(fontWeight: FontWeight.w600), + style: localTheme.textTheme.subtitle1.copyWith(fontWeight: FontWeight.w600), ), const SizedBox(width: 16.0), Text('${model.totalCartQuantity} ITEMS'), @@ -108,8 +108,8 @@ class ShoppingCartSummary extends StatelessWidget { @override Widget build(BuildContext context) { - final TextStyle smallAmountStyle = Theme.of(context).textTheme.body1.copyWith(color: kShrineBrown600); - final TextStyle largeAmountStyle = Theme.of(context).textTheme.display1; + final TextStyle smallAmountStyle = Theme.of(context).textTheme.bodyText2.copyWith(color: kShrineBrown600); + final TextStyle largeAmountStyle = Theme.of(context).textTheme.headline4; final NumberFormat formatter = NumberFormat.simpleCurrency( decimalDigits: 2, locale: Localizations.localeOf(context).toString(), @@ -242,7 +242,7 @@ class ShoppingCartRow extends StatelessWidget { ), Text( product.name, - style: localTheme.textTheme.subhead.copyWith(fontWeight: FontWeight.w600), + style: localTheme.textTheme.subtitle1.copyWith(fontWeight: FontWeight.w600), ), ], ), diff --git a/examples/flutter_gallery/lib/demo/typography_demo.dart b/examples/flutter_gallery/lib/demo/typography_demo.dart index e87f93899ee..5395fc660ca 100644 --- a/examples/flutter_gallery/lib/demo/typography_demo.dart +++ b/examples/flutter_gallery/lib/demo/typography_demo.dart @@ -49,15 +49,15 @@ class TypographyDemo extends StatelessWidget { final TextTheme textTheme = Theme.of(context).textTheme; final List styleItems = [ if (MediaQuery.of(context).size.width > 500.0) - TextStyleItem(name: 'Display 4', style: textTheme.display4, text: 'Light 112sp'), - TextStyleItem(name: 'Display 3', style: textTheme.display3, text: 'Regular 56sp'), - TextStyleItem(name: 'Display 2', style: textTheme.display2, text: 'Regular 45sp'), - TextStyleItem(name: 'Display 1', style: textTheme.display1, text: 'Regular 34sp'), - TextStyleItem(name: 'Headline', style: textTheme.headline, text: 'Regular 24sp'), - TextStyleItem(name: 'Title', style: textTheme.title, text: 'Medium 20sp'), - TextStyleItem(name: 'Subheading', style: textTheme.subhead, text: 'Regular 16sp'), - TextStyleItem(name: 'Body 2', style: textTheme.body2, text: 'Medium 14sp'), - TextStyleItem(name: 'Body 1', style: textTheme.body1, text: 'Regular 14sp'), + TextStyleItem(name: 'Headline 1', style: textTheme.headline1, text: 'Light 112sp'), + TextStyleItem(name: 'Headline 2', style: textTheme.headline2, text: 'Regular 56sp'), + TextStyleItem(name: 'Headline 3', style: textTheme.headline3, text: 'Regular 45sp'), + TextStyleItem(name: 'Headline 4', style: textTheme.headline4, text: 'Regular 34sp'), + TextStyleItem(name: 'Headline 5', style: textTheme.headline5, text: 'Regular 24sp'), + TextStyleItem(name: 'Headline 6', style: textTheme.headline6, text: 'Medium 20sp'), + TextStyleItem(name: 'Subtitle 1', style: textTheme.subtitle1, text: 'Regular 16sp'), + TextStyleItem(name: 'Body 1', style: textTheme.bodyText1, text: 'Medium 14sp'), + TextStyleItem(name: 'Body 2', style: textTheme.bodyText2, text: 'Regular 14sp'), TextStyleItem(name: 'Caption', style: textTheme.caption, text: 'Regular 12sp'), TextStyleItem(name: 'Button', style: textTheme.button, text: 'MEDIUM (ALL CAPS) 14sp'), ]; diff --git a/examples/flutter_gallery/lib/gallery/about.dart b/examples/flutter_gallery/lib/gallery/about.dart index 925799f01ef..144cfdf48fb 100644 --- a/examples/flutter_gallery/lib/gallery/about.dart +++ b/examples/flutter_gallery/lib/gallery/about.dart @@ -34,8 +34,8 @@ class _LinkTextSpan extends TextSpan { void showGalleryAboutDialog(BuildContext context) { final ThemeData themeData = Theme.of(context); - final TextStyle aboutTextStyle = themeData.textTheme.body2; - final TextStyle linkStyle = themeData.textTheme.body2.copyWith(color: themeData.accentColor); + final TextStyle aboutTextStyle = themeData.textTheme.bodyText1; + final TextStyle linkStyle = themeData.textTheme.bodyText1.copyWith(color: themeData.accentColor); showAboutDialog( context: context, diff --git a/examples/flutter_gallery/lib/gallery/backdrop.dart b/examples/flutter_gallery/lib/gallery/backdrop.dart index d930779b552..3f077c5ea07 100644 --- a/examples/flutter_gallery/lib/gallery/backdrop.dart +++ b/examples/flutter_gallery/lib/gallery/backdrop.dart @@ -151,7 +151,7 @@ class _BackAppBar extends StatelessWidget { return IconTheme.merge( data: theme.primaryIconTheme, child: DefaultTextStyle( - style: theme.primaryTextTheme.title, + style: theme.primaryTextTheme.headline6, child: SizedBox( height: _kBackAppBarHeight, child: Row( diff --git a/examples/flutter_gallery/lib/gallery/demo.dart b/examples/flutter_gallery/lib/gallery/demo.dart index d30cf3235eb..18d39bcd556 100644 --- a/examples/flutter_gallery/lib/gallery/demo.dart +++ b/examples/flutter_gallery/lib/gallery/demo.dart @@ -133,7 +133,7 @@ class TabbedComponentDemoScaffold extends StatelessWidget { Padding( padding: const EdgeInsets.all(16.0), child: Text(demo.description, - style: Theme.of(context).textTheme.subhead, + style: Theme.of(context).textTheme.subtitle1, ), ), Expanded(child: demo.demoWidget), diff --git a/examples/flutter_gallery/lib/gallery/home.dart b/examples/flutter_gallery/lib/gallery/home.dart index b70c11d22d8..ee569f8134f 100644 --- a/examples/flutter_gallery/lib/gallery/home.dart +++ b/examples/flutter_gallery/lib/gallery/home.dart @@ -83,7 +83,7 @@ class _CategoryItem extends StatelessWidget { child: Text( category.name, textAlign: TextAlign.center, - style: theme.textTheme.subhead.copyWith( + style: theme.textTheme.subtitle1.copyWith( fontFamily: 'GoogleSans', color: isDark ? Colors.white : _kFlutterBlue, ), @@ -212,14 +212,14 @@ class _DemoItem extends StatelessWidget { children: [ Text( demo.title, - style: theme.textTheme.subhead.copyWith( + style: theme.textTheme.subtitle1.copyWith( color: isDark ? Colors.white : const Color(0xFF202124), ), ), if (demo.subtitle != null) Text( demo.subtitle, - style: theme.textTheme.body1.copyWith( + style: theme.textTheme.bodyText2.copyWith( color: isDark ? Colors.white : const Color(0xFF60646B) ), ), diff --git a/examples/flutter_gallery/lib/gallery/options.dart b/examples/flutter_gallery/lib/gallery/options.dart index 36e10da192f..0bb47657a3e 100644 --- a/examples/flutter_gallery/lib/gallery/options.dart +++ b/examples/flutter_gallery/lib/gallery/options.dart @@ -177,7 +177,7 @@ class _FlatButton extends StatelessWidget { padding: EdgeInsets.zero, onPressed: onPressed, child: DefaultTextStyle( - style: Theme.of(context).primaryTextTheme.subhead, + style: Theme.of(context).primaryTextTheme.subtitle1, child: child, ), ); @@ -194,7 +194,7 @@ class _Heading extends StatelessWidget { final ThemeData theme = Theme.of(context); return _OptionsItem( child: DefaultTextStyle( - style: theme.textTheme.title.copyWith( + style: theme.textTheme.headline6.copyWith( fontFamily: 'GoogleSans', color: theme.colorScheme.onPrimary, fontWeight: FontWeight.w700, @@ -232,7 +232,7 @@ class _ThemeModeItem extends StatelessWidget { const Text('Theme'), Text( 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'), Text( 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'), Text( 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'), Text( _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); return DefaultTextStyle( - style: theme.primaryTextTheme.subhead, + style: theme.primaryTextTheme.subtitle1, child: ListView( padding: const EdgeInsets.only(bottom: 124.0), children: [ diff --git a/examples/flutter_gallery/lib/gallery/themes.dart b/examples/flutter_gallery/lib/gallery/themes.dart index d03aede04c4..2f271c7c73b 100644 --- a/examples/flutter_gallery/lib/gallery/themes.dart +++ b/examples/flutter_gallery/lib/gallery/themes.dart @@ -9,7 +9,7 @@ final ThemeData kDarkGalleryTheme = _buildDarkTheme(); TextTheme _buildTextTheme(TextTheme base) { return base.copyWith( - title: base.title.copyWith( + headline6: base.headline6.copyWith( fontFamily: 'GoogleSans', ), ); diff --git a/examples/flutter_gallery/lib/gallery/updater.dart b/examples/flutter_gallery/lib/gallery/updater.dart index cb2bddee3cf..1c1250701e6 100644 --- a/examples/flutter_gallery/lib/gallery/updater.dart +++ b/examples/flutter_gallery/lib/gallery/updater.dart @@ -49,7 +49,7 @@ class UpdaterState extends State { Widget _buildDialog(BuildContext context) { final ThemeData theme = Theme.of(context); final TextStyle dialogTextStyle = - theme.textTheme.subhead.copyWith(color: theme.textTheme.caption.color); + theme.textTheme.subtitle1.copyWith(color: theme.textTheme.caption.color); return AlertDialog( title: const Text('Update Flutter Gallery?'), content: Text('A newer version is available.', style: dialogTextStyle), diff --git a/examples/image_list/lib/main.dart b/examples/image_list/lib/main.dart index ac2e3d75c32..c2530addad8 100644 --- a/examples/image_list/lib/main.dart +++ b/examples/image_list/lib/main.dart @@ -202,7 +202,7 @@ class _MyHomePageState extends State with TickerProviderStateMixin { ), Text( '$_counter', - style: Theme.of(context).textTheme.display1, + style: Theme.of(context).textTheme.headline4, ), ], ), diff --git a/examples/stocks/lib/stock_symbol_viewer.dart b/examples/stocks/lib/stock_symbol_viewer.dart index 26d0d860f15..88a2f8efb02 100644 --- a/examples/stocks/lib/stock_symbol_viewer.dart +++ b/examples/stocks/lib/stock_symbol_viewer.dart @@ -21,7 +21,7 @@ class _StockSymbolView extends StatelessWidget { if (stock.percentChange > 0) changeInPrice = '+' + changeInPrice; - final TextStyle headings = Theme.of(context).textTheme.body2; + final TextStyle headings = Theme.of(context).textTheme.bodyText1; return Container( padding: const EdgeInsets.all(20.0), child: Column( @@ -31,7 +31,7 @@ class _StockSymbolView extends StatelessWidget { Text( stock.symbol, key: ValueKey('${stock.symbol}_symbol_name'), - style: Theme.of(context).textTheme.display2, + style: Theme.of(context).textTheme.headline3, ), arrow, ], diff --git a/packages/flutter/lib/src/animation/curves.dart b/packages/flutter/lib/src/animation/curves.dart index 4e3c474dd08..707ee10de30 100644 --- a/packages/flutter/lib/src/animation/curves.dart +++ b/packages/flutter/lib/src/animation/curves.dart @@ -413,7 +413,7 @@ class Cubic extends Curve { /// child: CircleAvatar( /// backgroundColor: Colors.yellow, /// child: DefaultTextStyle( -/// style: Theme.of(context).textTheme.title, +/// style: Theme.of(context).textTheme.headline6, /// child: Text("B"), // Buzz, buzz! /// ), /// ), diff --git a/packages/flutter/lib/src/material/about.dart b/packages/flutter/lib/src/material/about.dart index 3fd501ea579..f811c8a11f6 100644 --- a/packages/flutter/lib/src/material/about.dart +++ b/packages/flutter/lib/src/material/about.dart @@ -41,7 +41,7 @@ import 'theme.dart'; /// ```dart /// /// Widget build(BuildContext context) { -/// final TextStyle textStyle = Theme.of(context).textTheme.body1; +/// final TextStyle textStyle = Theme.of(context).textTheme.bodyText2; /// final List aboutBoxChildren = [ /// SizedBox(height: 24), /// RichText( @@ -374,8 +374,8 @@ class AboutDialog extends StatelessWidget { padding: const EdgeInsets.symmetric(horizontal: 24.0), child: ListBody( children: [ - Text(name, style: Theme.of(context).textTheme.headline), - Text(version, style: Theme.of(context).textTheme.body1), + Text(name, style: Theme.of(context).textTheme.headline5), + Text(version, style: Theme.of(context).textTheme.bodyText2), Container(height: 18.0), Text(applicationLegalese ?? '', style: Theme.of(context).textTheme.caption), ], @@ -576,13 +576,13 @@ class _LicensePageState extends State { child: ListView( padding: const EdgeInsets.symmetric(horizontal: 8.0, vertical: 12.0), children: [ - 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), - 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), Text(widget.applicationLegalese ?? '', style: Theme.of(context).textTheme.caption, textAlign: TextAlign.center), 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), ..._licenses, if (!_loaded) diff --git a/packages/flutter/lib/src/material/app_bar.dart b/packages/flutter/lib/src/material/app_bar.dart index e76c45fe18a..1108d1293e6 100644 --- a/packages/flutter/lib/src/material/app_bar.dart +++ b/packages/flutter/lib/src/material/app_bar.dart @@ -434,12 +434,12 @@ class _AppBarState extends State { IconThemeData actionsIconTheme = widget.actionsIconTheme ?? appBarTheme.actionsIconTheme ?? overallIconTheme; - TextStyle centerStyle = widget.textTheme?.title - ?? appBarTheme.textTheme?.title - ?? theme.primaryTextTheme.title; - TextStyle sideStyle = widget.textTheme?.body1 - ?? appBarTheme.textTheme?.body1 - ?? theme.primaryTextTheme.body1; + TextStyle centerStyle = widget.textTheme?.headline6 + ?? appBarTheme.textTheme?.headline6 + ?? theme.primaryTextTheme.headline6; + TextStyle sideStyle = widget.textTheme?.bodyText2 + ?? appBarTheme.textTheme?.bodyText2 + ?? theme.primaryTextTheme.bodyText2; if (widget.toolbarOpacity != 1.0) { final double opacity = const Interval(0.25, 1.0, curve: Curves.fastOutSlowIn).transform(widget.toolbarOpacity); diff --git a/packages/flutter/lib/src/material/banner.dart b/packages/flutter/lib/src/material/banner.dart index cfbbdf37ff7..25e5879249d 100644 --- a/packages/flutter/lib/src/material/banner.dart +++ b/packages/flutter/lib/src/material/banner.dart @@ -57,7 +57,7 @@ class MaterialBanner extends StatelessWidget { /// Style for the text in the [content] of the [MaterialBanner]. /// /// 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; /// 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; final TextStyle textStyle = contentTextStyle ?? bannerTheme.contentTextStyle - ?? theme.textTheme.body1; + ?? theme.textTheme.bodyText2; return Container( color: backgroundColor, diff --git a/packages/flutter/lib/src/material/chip_theme.dart b/packages/flutter/lib/src/material/chip_theme.dart index 7fa1217a8d6..bb5b64bc1a2 100644 --- a/packages/flutter/lib/src/material/chip_theme.dart +++ b/packages/flutter/lib/src/material/chip_theme.dart @@ -510,7 +510,7 @@ class ChipThemeData extends Diagnosticable { final ChipThemeData defaultData = ChipThemeData.fromDefaults( secondaryColor: defaultTheme.primaryColor, brightness: defaultTheme.brightness, - labelStyle: defaultTheme.textTheme.body2, + labelStyle: defaultTheme.textTheme.bodyText1, ); properties.add(ColorProperty('backgroundColor', backgroundColor, defaultValue: defaultData.backgroundColor)); properties.add(ColorProperty('deleteIconColor', deleteIconColor, defaultValue: defaultData.deleteIconColor)); diff --git a/packages/flutter/lib/src/material/circle_avatar.dart b/packages/flutter/lib/src/material/circle_avatar.dart index 7d5cb992b95..8534bc8a309 100644 --- a/packages/flutter/lib/src/material/circle_avatar.dart +++ b/packages/flutter/lib/src/material/circle_avatar.dart @@ -166,7 +166,7 @@ class CircleAvatar extends StatelessWidget { Widget build(BuildContext context) { assert(debugCheckHasMediaQuery(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; if (effectiveBackgroundColor == null) { switch (ThemeData.estimateBrightnessForColor(textStyle.color)) { diff --git a/packages/flutter/lib/src/material/date_picker.dart b/packages/flutter/lib/src/material/date_picker.dart index 8a17d2db7e4..9c63ae25b9c 100644 --- a/packages/flutter/lib/src/material/date_picker.dart +++ b/packages/flutter/lib/src/material/date_picker.dart @@ -90,8 +90,8 @@ class _DatePickerHeader extends StatelessWidget { yearColor = mode == DatePickerMode.year ? Colors.white : Colors.white70; break; } - final TextStyle dayStyle = headerTextTheme.display1.copyWith(color: dayColor); - final TextStyle yearStyle = headerTextTheme.subhead.copyWith(color: yearColor); + final TextStyle dayStyle = headerTextTheme.headline4.copyWith(color: dayColor); + final TextStyle yearStyle = headerTextTheme.subtitle1.copyWith(color: yearColor); Color backgroundColor; switch (themeData.brightness) { @@ -409,21 +409,21 @@ class DayPicker extends StatelessWidget { || (selectableDayPredicate != null && !selectableDayPredicate(dayToBuild)); BoxDecoration decoration; - TextStyle itemStyle = themeData.textTheme.body1; + TextStyle itemStyle = themeData.textTheme.bodyText2; final bool isSelectedDay = selectedDate.year == year && selectedDate.month == month && selectedDate.day == day; if (isSelectedDay) { // The selected day gets a circle background highlight, and a contrasting text color. - itemStyle = themeData.accentTextTheme.body2; + itemStyle = themeData.accentTextTheme.bodyText1; decoration = BoxDecoration( color: themeData.accentColor, shape: BoxShape.circle, ); } 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) { // 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( @@ -471,7 +471,7 @@ class DayPicker extends StatelessWidget { child: ExcludeSemantics( child: Text( localizations.formatMonthYear(displayedMonth), - style: themeData.textTheme.subhead, + style: themeData.textTheme.subtitle1, ), ), ), @@ -824,7 +824,7 @@ class _YearPickerState extends State { Widget build(BuildContext context) { assert(debugCheckHasMaterial(context)); final ThemeData themeData = Theme.of(context); - final TextStyle style = themeData.textTheme.body1; + final TextStyle style = themeData.textTheme.bodyText2; return ListView.builder( dragStartBehavior: widget.dragStartBehavior, controller: scrollController, @@ -834,7 +834,7 @@ class _YearPickerState extends State { final int year = widget.firstDate.year + index; final bool isSelected = year == widget.selectedDate.year; final TextStyle itemStyle = isSelected - ? themeData.textTheme.headline.copyWith(color: themeData.accentColor) + ? themeData.textTheme.headline5.copyWith(color: themeData.accentColor) : style; return InkWell( key: ValueKey(year), diff --git a/packages/flutter/lib/src/material/dialog.dart b/packages/flutter/lib/src/material/dialog.dart index 53fe291dfad..c9e99cf39d2 100644 --- a/packages/flutter/lib/src/material/dialog.dart +++ b/packages/flutter/lib/src/material/dialog.dart @@ -253,7 +253,7 @@ class AlertDialog extends StatelessWidget { /// Style for the text in the [title] of this [AlertDialog]. /// /// If null, [DialogTheme.titleTextStyle] is used, if that's null, defaults to - /// [ThemeData.textTheme.title]. + /// [ThemeData.textTheme.headline6]. final TextStyle titleTextStyle; /// 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]. /// /// If null, [DialogTheme.contentTextStyle] is used, if that's null, defaults - /// to [ThemeData.textTheme.subhead]. + /// to [ThemeData.textTheme.subtitle1]. final TextStyle contentTextStyle; /// The (optional) set of actions that are displayed at the bottom of the @@ -421,7 +421,7 @@ class AlertDialog extends StatelessWidget { titleWidget = Padding( padding: titlePadding ?? EdgeInsets.fromLTRB(24.0, 24.0, 24.0, content == null ? 20.0 : 0.0), child: DefaultTextStyle( - style: titleTextStyle ?? dialogTheme.titleTextStyle ?? theme.textTheme.title, + style: titleTextStyle ?? dialogTheme.titleTextStyle ?? theme.textTheme.headline6, child: Semantics( child: title, namesRoute: true, @@ -434,7 +434,7 @@ class AlertDialog extends StatelessWidget { contentWidget = Padding( padding: contentPadding, child: DefaultTextStyle( - style: contentTextStyle ?? dialogTheme.contentTextStyle ?? theme.textTheme.subhead, + style: contentTextStyle ?? dialogTheme.contentTextStyle ?? theme.textTheme.subtitle1, child: content, ), ); @@ -747,7 +747,7 @@ class SimpleDialog extends StatelessWidget { Padding( padding: titlePadding, child: DefaultTextStyle( - style: theme.textTheme.title, + style: theme.textTheme.headline6, child: Semantics(namesRoute: true, child: title), ), ), diff --git a/packages/flutter/lib/src/material/dialog_theme.dart b/packages/flutter/lib/src/material/dialog_theme.dart index 995bdde2953..48ae8f7f29e 100644 --- a/packages/flutter/lib/src/material/dialog_theme.dart +++ b/packages/flutter/lib/src/material/dialog_theme.dart @@ -19,7 +19,7 @@ import 'theme.dart'; /// a border radius of 2.0 on all corners. /// /// [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. /// /// See also: @@ -53,12 +53,12 @@ class DialogTheme extends Diagnosticable { /// 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; /// 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; /// Creates a copy of this object but with the given fields replaced with the diff --git a/packages/flutter/lib/src/material/drawer_header.dart b/packages/flutter/lib/src/material/drawer_header.dart index c064e3b3ec7..62ff66a571c 100644 --- a/packages/flutter/lib/src/material/drawer_header.dart +++ b/packages/flutter/lib/src/material/drawer_header.dart @@ -91,7 +91,7 @@ class DrawerHeader extends StatelessWidget { duration: duration, curve: curve, child: child == null ? null : DefaultTextStyle( - style: theme.textTheme.body2, + style: theme.textTheme.bodyText1, child: MediaQuery.removePadding( context: context, removeTop: true, diff --git a/packages/flutter/lib/src/material/dropdown.dart b/packages/flutter/lib/src/material/dropdown.dart index dfd0398338b..2cedb414fe2 100644 --- a/packages/flutter/lib/src/material/dropdown.dart +++ b/packages/flutter/lib/src/material/dropdown.dart @@ -958,7 +958,7 @@ class DropdownButton extends StatefulWidget { /// ``` /// {@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]. final TextStyle style; @@ -1128,7 +1128,7 @@ class _DropdownButtonState extends State> with WidgetsBindi } } - TextStyle get _textStyle => widget.style ?? Theme.of(context).textTheme.subhead; + TextStyle get _textStyle => widget.style ?? Theme.of(context).textTheme.subtitle1; void _handleTap() { final RenderBox itemBox = context.findRenderObject() as RenderBox; @@ -1184,7 +1184,7 @@ class _DropdownButtonState extends State> with WidgetsBindi // Similarly, we don't reduce the height of the button so much that its icon // would be clipped. 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)); } diff --git a/packages/flutter/lib/src/material/expansion_tile.dart b/packages/flutter/lib/src/material/expansion_tile.dart index 0121e75fc1b..fc7223566e2 100644 --- a/packages/flutter/lib/src/material/expansion_tile.dart +++ b/packages/flutter/lib/src/material/expansion_tile.dart @@ -191,7 +191,7 @@ class _ExpansionTileState extends State with SingleTickerProvider _borderColorTween ..end = theme.dividerColor; _headerColorTween - ..begin = theme.textTheme.subhead.color + ..begin = theme.textTheme.subtitle1.color ..end = theme.accentColor; _iconColorTween ..begin = theme.unselectedWidgetColor diff --git a/packages/flutter/lib/src/material/flexible_space_bar.dart b/packages/flutter/lib/src/material/flexible_space_bar.dart index a53890bf9e9..dfaa9f4efcd 100644 --- a/packages/flutter/lib/src/material/flexible_space_bar.dart +++ b/packages/flutter/lib/src/material/flexible_space_bar.dart @@ -367,7 +367,7 @@ class _FlexibleSpaceBarState extends State { final double opacity = settings.toolbarOpacity; if (opacity > 0.0) { - TextStyle titleStyle = theme.primaryTextTheme.title; + TextStyle titleStyle = theme.primaryTextTheme.headline6; titleStyle = titleStyle.copyWith( color: titleStyle.color.withOpacity(opacity) ); diff --git a/packages/flutter/lib/src/material/grid_tile_bar.dart b/packages/flutter/lib/src/material/grid_tile_bar.dart index 6b60db63ce1..33ea1294784 100644 --- a/packages/flutter/lib/src/material/grid_tile_bar.dart +++ b/packages/flutter/lib/src/material/grid_tile_bar.dart @@ -93,7 +93,7 @@ class GridTileBar extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ DefaultTextStyle( - style: darkTheme.textTheme.subhead, + style: darkTheme.textTheme.subtitle1, softWrap: false, overflow: TextOverflow.ellipsis, child: title, @@ -110,7 +110,7 @@ class GridTileBar extends StatelessWidget { else if (title != null || subtitle != null) Expanded( child: DefaultTextStyle( - style: darkTheme.textTheme.subhead, + style: darkTheme.textTheme.subtitle1, softWrap: false, overflow: TextOverflow.ellipsis, child: title ?? subtitle, diff --git a/packages/flutter/lib/src/material/input_decorator.dart b/packages/flutter/lib/src/material/input_decorator.dart index 8a4e199d49c..00cbb800b13 100644 --- a/packages/flutter/lib/src/material/input_decorator.dart +++ b/packages/flutter/lib/src/material/input_decorator.dart @@ -1763,7 +1763,7 @@ class InputDecorator extends StatefulWidget { /// The style on which to base the label, hint, counter, and error 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]. /// /// The [TextStyle.textBaseline] of the [baseStyle] is used to determine @@ -2049,7 +2049,7 @@ class _InputDecoratorState extends State with TickerProviderStat // 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. 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); } @@ -2057,7 +2057,7 @@ class _InputDecoratorState extends State with TickerProviderStat final Color color = decoration.errorText != null ? decoration.errorStyle?.color ?? themeData.errorColor : _getActiveColor(themeData); - final TextStyle style = themeData.textTheme.subhead.merge(widget.baseStyle); + final TextStyle style = themeData.textTheme.subtitle1.merge(widget.baseStyle); return style .copyWith(color: decoration.enabled ? color : themeData.disabledColor) .merge(decoration.labelStyle); diff --git a/packages/flutter/lib/src/material/list_tile.dart b/packages/flutter/lib/src/material/list_tile.dart index 13bb1e6a41c..dba76f30a98 100644 --- a/packages/flutter/lib/src/material/list_tile.dart +++ b/packages/flutter/lib/src/material/list_tile.dart @@ -17,8 +17,8 @@ import 'theme.dart'; /// Defines the title font used for [ListTile] descendants of a [ListTileTheme]. /// -/// List tiles that appear in a [Drawer] use the theme's [TextTheme.body2] -/// text style, which is a little smaller than the theme's [TextTheme.subhead] +/// 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.subtitle1] /// text style, which is used by default. enum ListTileStyle { /// Use a title font that's appropriate for a [ListTile] in a list. @@ -806,14 +806,14 @@ class ListTile extends StatelessWidget { if (tileTheme != null) { switch (tileTheme.style) { case ListTileStyle.drawer: - style = theme.textTheme.body2; + style = theme.textTheme.bodyText1; break; case ListTileStyle.list: - style = theme.textTheme.subhead; + style = theme.textTheme.subtitle1; break; } } else { - style = theme.textTheme.subhead; + style = theme.textTheme.subtitle1; } final Color color = _textColor(theme, tileTheme, style.color); return _isDenseLayout(tileTheme) @@ -822,7 +822,7 @@ class ListTile extends StatelessWidget { } 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); return _isDenseLayout(tileTheme) ? style.copyWith(color: color, fontSize: 12.0) diff --git a/packages/flutter/lib/src/material/material.dart b/packages/flutter/lib/src/material/material.dart index 39f3d2aad59..7f8d10585e0 100644 --- a/packages/flutter/lib/src/material/material.dart +++ b/packages/flutter/lib/src/material/material.dart @@ -351,7 +351,7 @@ class _MaterialState extends State with TickerProviderStateMixin { Widget contents = widget.child; if (contents != null) { contents = AnimatedDefaultTextStyle( - style: widget.textStyle ?? Theme.of(context).textTheme.body1, + style: widget.textStyle ?? Theme.of(context).textTheme.bodyText2, duration: widget.animationDuration, child: contents, ); diff --git a/packages/flutter/lib/src/material/paginated_data_table.dart b/packages/flutter/lib/src/material/paginated_data_table.dart index f42c3972576..ca82b1b385c 100644 --- a/packages/flutter/lib/src/material/paginated_data_table.dart +++ b/packages/flutter/lib/src/material/paginated_data_table.dart @@ -439,8 +439,8 @@ class PaginatedDataTableState extends State { // These typographic styles aren't quite the regular ones. We pick the closest ones from the regular // list and then tweak them appropriately. // See https://material.io/design/components/data-tables.html#tables-within-cards - style: _selectedRowCount > 0 ? themeData.textTheme.subhead.copyWith(color: themeData.accentColor) - : themeData.textTheme.title.copyWith(fontWeight: FontWeight.w400), + style: _selectedRowCount > 0 ? themeData.textTheme.subtitle1.copyWith(color: themeData.accentColor) + : themeData.textTheme.headline6.copyWith(fontWeight: FontWeight.w400), child: IconTheme.merge( data: const IconThemeData( opacity: 0.54 diff --git a/packages/flutter/lib/src/material/popup_menu.dart b/packages/flutter/lib/src/material/popup_menu.dart index 1b61e3925f6..4e092c3200a 100644 --- a/packages/flutter/lib/src/material/popup_menu.dart +++ b/packages/flutter/lib/src/material/popup_menu.dart @@ -239,7 +239,7 @@ class PopupMenuItem extends PopupMenuEntry { /// The text style of the popup menu item. /// /// 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; /// The widget below this widget in the tree. @@ -297,7 +297,7 @@ class PopupMenuItemState> extends State { Widget build(BuildContext context) { final ThemeData theme = Theme.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) style = style.copyWith(color: theme.disabledColor); diff --git a/packages/flutter/lib/src/material/range_slider.dart b/packages/flutter/lib/src/material/range_slider.dart index 58113ec73d8..9f575eec91c 100644 --- a/packages/flutter/lib/src/material/range_slider.dart +++ b/packages/flutter/lib/src/material/range_slider.dart @@ -273,7 +273,7 @@ class RangeSlider extends StatefulWidget { /// There are two labels: one for the start thumb and one for the end thumb. /// /// 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 /// style can be overridden with [SliderThemeData.valueIndicatorTextStyle]. /// @@ -564,7 +564,7 @@ class _RangeSliderState extends State with TickerProviderStateMixin overlayShape: sliderTheme.overlayShape ?? _defaultOverlayShape, rangeValueIndicatorShape: sliderTheme.rangeValueIndicatorShape ?? _defaultValueIndicatorShape, showValueIndicator: sliderTheme.showValueIndicator ?? _defaultShowValueIndicator, - valueIndicatorTextStyle: sliderTheme.valueIndicatorTextStyle ?? theme.textTheme.body2.copyWith( + valueIndicatorTextStyle: sliderTheme.valueIndicatorTextStyle ?? theme.textTheme.bodyText1.copyWith( color: theme.colorScheme.onPrimary, ), minThumbSeparation: sliderTheme.minThumbSeparation ?? _defaultMinThumbSeparation, diff --git a/packages/flutter/lib/src/material/search.dart b/packages/flutter/lib/src/material/search.dart index 9ddf0ae2201..c124e2bb891 100644 --- a/packages/flutter/lib/src/material/search.dart +++ b/packages/flutter/lib/src/material/search.dart @@ -510,7 +510,7 @@ class _SearchPageState extends State<_SearchPage> { title: TextField( controller: widget.delegate._queryTextController, focusNode: focusNode, - style: theme.textTheme.title, + style: theme.textTheme.headline6, textInputAction: widget.delegate.textInputAction, keyboardType: widget.delegate.keyboardType, onSubmitted: (String _) { diff --git a/packages/flutter/lib/src/material/slider.dart b/packages/flutter/lib/src/material/slider.dart index d1f158180fd..77ce0e5edb7 100644 --- a/packages/flutter/lib/src/material/slider.dart +++ b/packages/flutter/lib/src/material/slider.dart @@ -302,7 +302,7 @@ class Slider extends StatefulWidget { /// as part of the value indicator shape. /// /// 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 /// can be overridden with [SliderThemeData.valueIndicatorTextStyle]. /// @@ -543,7 +543,7 @@ class _SliderState extends State with TickerProviderStateMixin { overlayShape: sliderTheme.overlayShape ?? _defaultOverlayShape, valueIndicatorShape: sliderTheme.valueIndicatorShape ?? _defaultValueIndicatorShape, showValueIndicator: sliderTheme.showValueIndicator ?? _defaultShowValueIndicator, - valueIndicatorTextStyle: sliderTheme.valueIndicatorTextStyle ?? theme.textTheme.body2.copyWith( + valueIndicatorTextStyle: sliderTheme.valueIndicatorTextStyle ?? theme.textTheme.bodyText1.copyWith( color: theme.colorScheme.onPrimary, ), ); diff --git a/packages/flutter/lib/src/material/snack_bar.dart b/packages/flutter/lib/src/material/snack_bar.dart index 614bc34263a..9c6656b0141 100644 --- a/packages/flutter/lib/src/material/snack_bar.dart +++ b/packages/flutter/lib/src/material/snack_bar.dart @@ -360,7 +360,7 @@ class _SnackBarState extends State { 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 bool isFloatingSnackBar = snackBarBehavior == SnackBarBehavior.floating; final double snackBarPadding = isFloatingSnackBar ? 16.0 : 24.0; diff --git a/packages/flutter/lib/src/material/stepper.dart b/packages/flutter/lib/src/material/stepper.dart index 8e9013d3a26..643f8fe9e78 100644 --- a/packages/flutter/lib/src/material/stepper.dart +++ b/packages/flutter/lib/src/material/stepper.dart @@ -444,13 +444,13 @@ class _StepperState extends State with TickerProviderStateMixin { case StepState.indexed: case StepState.editing: case StepState.complete: - return textTheme.body2; + return textTheme.bodyText1; case StepState.disabled: - return textTheme.body2.copyWith( + return textTheme.bodyText1.copyWith( color: _isDark() ? _kDisabledDark : _kDisabledLight ); case StepState.error: - return textTheme.body2.copyWith( + return textTheme.bodyText1.copyWith( color: _isDark() ? _kErrorDark : _kErrorLight ); } diff --git a/packages/flutter/lib/src/material/tabs.dart b/packages/flutter/lib/src/material/tabs.dart index b14517be2da..4052cef7cfd 100644 --- a/packages/flutter/lib/src/material/tabs.dart +++ b/packages/flutter/lib/src/material/tabs.dart @@ -171,12 +171,12 @@ class _TabStyle extends AnimatedWidget { // the same value of inherit. Force that to be inherit=true here. final TextStyle defaultStyle = (labelStyle ?? tabBarTheme.labelStyle - ?? themeData.primaryTextTheme.body2 + ?? themeData.primaryTextTheme.bodyText1 ).copyWith(inherit: true); final TextStyle defaultUnselectedStyle = (unselectedLabelStyle ?? tabBarTheme.unselectedLabelStyle ?? labelStyle - ?? themeData.primaryTextTheme.body2 + ?? themeData.primaryTextTheme.bodyText1 ).copyWith(inherit: true); final TextStyle textStyle = selected ? TextStyle.lerp(defaultStyle, defaultUnselectedStyle, animation.value) @@ -184,7 +184,7 @@ class _TabStyle extends AnimatedWidget { final Color selectedColor = labelColor ?? tabBarTheme.labelColor - ?? themeData.primaryTextTheme.body2.color; + ?? themeData.primaryTextTheme.bodyText1.color; final Color unselectedColor = unselectedLabelColor ?? tabBarTheme.unselectedLabelColor ?? selectedColor.withAlpha(0xB2); // 70% alpha @@ -701,7 +701,7 @@ class TabBar extends StatefulWidget implements PreferredSizeWidget { /// opacity unless [unselectedLabelColor] is non-null. /// /// 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; /// The color of unselected tab labels. @@ -716,7 +716,7 @@ class TabBar extends StatefulWidget implements PreferredSizeWidget { /// both selected and unselected label styles. /// /// 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; /// 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] /// is null, then the text style of the [ThemeData.primaryTextTheme]'s - /// body2 definition is used. + /// bodyText1 definition is used. final TextStyle unselectedLabelStyle; /// {@macro flutter.widgets.scrollable.dragStartBehavior} diff --git a/packages/flutter/lib/src/material/text_field.dart b/packages/flutter/lib/src/material/text_field.dart index fa5f267c136..032250a5054 100644 --- a/packages/flutter/lib/src/material/text_field.dart +++ b/packages/flutter/lib/src/material/text_field.dart @@ -439,7 +439,7 @@ class TextField extends StatefulWidget { /// /// 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; /// {@macro flutter.widgets.editableText.strutStyle} @@ -929,7 +929,7 @@ class _TextFieldState extends State implements TextSelectionGestureDe ); 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 TextEditingController controller = _effectiveController; final FocusNode focusNode = _effectiveFocusNode; diff --git a/packages/flutter/lib/src/material/text_theme.dart b/packages/flutter/lib/src/material/text_theme.dart index 870d4c231e1..349c641b687 100644 --- a/packages/flutter/lib/src/material/text_theme.dart +++ b/packages/flutter/lib/src/material/text_theme.dart @@ -7,15 +7,29 @@ import 'package:flutter/painting.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. /// -/// 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, /// you can obtain an instance as [Typography.black] or [Typography.white]. /// /// To obtain the current text theme, call [Theme.of] with the current /// [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 /// current (2018) version of the specification /// (https://material.io/design/typography). @@ -25,32 +39,33 @@ import 'typography.dart'; /// NAME SIZE WEIGHT SPACING /// headline1 96.0 light -1.5 /// headline2 60.0 light -0.5 -/// headline3 48.0 normal 0.0 -/// headline4 34.0 normal 0.25 -/// headline5 24.0 normal 0.0 +/// headline3 48.0 regular 0.0 +/// headline4 34.0 regular 0.25 +/// headline5 24.0 regular 0.0 /// headline6 20.0 medium 0.15 -/// subtitle1 16.0 normal 0.15 +/// subtitle1 16.0 regular 0.15 /// subtitle2 14.0 medium 0.1 -/// body1 16.0 normal 0.5 -/// body2 14.0 normal 0.25 -/// button 14.0 medium 0.75 -/// caption 12.0 normal 0.4 -/// overline 10.0 normal 1.5 -/// +/// body1 16.0 regular 0.5 (bodyText1) +/// body2 14.0 regular 0.25 (bodyText2) +/// button 14.0 medium 1.25 +/// caption 12.0 regular 0.4 +/// 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`. /// -/// 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 -/// compatibility's sake, this API continues to use the original -/// names. The table below should help with understanding the API in -/// terms of the 2018 material spec. +/// compatibility's sake, this API continues to expose the old names. The table +/// below should help with understanding the mapping of the API's old names and +/// the new names (those in terms of the 2018 material specification). /// /// Each of the [TextTheme] text styles corresponds to one of the /// styles from 2018 spec. By default, the font sizes, font weights /// and letter spacings have not changed from their original, /// 2014, values. +/// /// ``` /// NAME SIZE WEIGHT SPACING 2018 NAME /// display4 112.0 thin 0.0 headline1 @@ -60,8 +75,8 @@ import 'typography.dart'; /// headline 24.0 normal 0.0 headline5 /// title 20.0 medium 0.0 headline6 /// subhead 16.0 normal 0.0 subtitle1 -/// body2 14.0 medium 0.0 body1 -/// body1 14.0 normal 0.0 body2 +/// body2 14.0 medium 0.0 body1 (bodyText1) +/// body1 14.0 normal 0.0 body2 (bodyText2) /// caption 12.0 normal 0.0 caption /// button 14.0 medium 0.0 button /// 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 /// 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, -/// initialize its [ThemeData.typography] value with a [Typography] that -/// 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) +/// initialize its [ThemeData.typography] value using [Typography.material2018]. /// /// See also: /// @@ -107,53 +115,120 @@ class TextTheme extends Diagnosticable { /// 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]. const TextTheme({ - this.display4, - this.display3, - this.display2, - this.display1, - this.headline, - this.title, - this.subhead, - this.body2, - this.body1, + TextStyle headline1, + TextStyle headline2, + TextStyle headline3, + TextStyle headline4, + TextStyle headline5, + TextStyle headline6, + TextStyle subtitle1, + TextStyle subtitle2, + TextStyle bodyText1, + TextStyle bodyText2, this.caption, this.button, - this.subtitle, 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. - /// - /// The font size is 112 pixels. - final TextStyle display4; + final TextStyle headline1; /// Very, very large text. /// /// Used for the date in the dialog shown by [showDatePicker]. - final TextStyle display3; + final TextStyle headline2; /// Very large text. - final TextStyle display2; + final TextStyle headline3; /// Large text. - final TextStyle display1; + final TextStyle headline4; /// Used for large text in dialogs (e.g., the month and year in the dialog /// shown by [showDatePicker]). - final TextStyle headline; + final TextStyle headline5; /// Used for the primary text in app bars and dialogs (e.g., [AppBar.title] /// and [AlertDialog.title]). - final TextStyle title; + final TextStyle headline6; /// 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]. - final TextStyle body2; + /// For medium emphasis text that's a little smaller than [subtitle1]. + final TextStyle subtitle2; + + /// Used for emphasizing text that would otherwise be [bodyText2]. + final TextStyle bodyText1; /// Used for the default text style for [Material]. - final TextStyle body1; + final TextStyle bodyText2; /// Used for auxiliary text associated with images. final TextStyle caption; @@ -161,14 +236,114 @@ class TextTheme extends Diagnosticable { /// Used for text on [RaisedButton] and [FlatButton]. final TextStyle button; - /// For medium emphasis text that's a little smaller than [subhead]. - final TextStyle subtitle; - - /// The smallest style, + /// The smallest style. /// /// Typically used for captions or to introduce a (larger) headline. 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 /// the new values. /// @@ -193,7 +368,7 @@ class TextTheme extends Diagnosticable { /// return Theme( /// data: theme.copyWith( /// textTheme: theme.textTheme.copyWith( - /// title: theme.textTheme.title.copyWith( + /// headline6: theme.textTheme.headline6.copyWith( /// color: titleColor, /// ), /// ), @@ -210,33 +385,90 @@ class TextTheme extends Diagnosticable { /// * [merge] is used instead of [copyWith] when you want to merge all /// of the fields of a TextTheme instead of individual fields. TextTheme copyWith({ - TextStyle display4, - TextStyle display3, - TextStyle display2, - TextStyle display1, - TextStyle headline, - TextStyle title, - TextStyle subhead, - TextStyle body2, - TextStyle body1, + TextStyle headline1, + TextStyle headline2, + TextStyle headline3, + TextStyle headline4, + TextStyle headline5, + TextStyle headline6, + TextStyle subtitle1, + TextStyle subtitle2, + TextStyle bodyText1, + TextStyle bodyText2, TextStyle caption, TextStyle button, - TextStyle subtitle, 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( - display4: display4 ?? this.display4, - display3: display3 ?? this.display3, - display2: display2 ?? this.display2, - display1: display1 ?? this.display1, - headline: headline ?? this.headline, - title: title ?? this.title, - subhead: subhead ?? this.subhead, - body2: body2 ?? this.body2, - body1: body1 ?? this.body1, + headline1: headline1 ?? display4 ?? this.headline1, + headline2: headline2 ?? display3 ?? this.headline2, + headline3: headline3 ?? display2 ?? this.headline3, + headline4: headline4 ?? display1 ?? this.headline4, + headline5: headline5 ?? headline ?? this.headline5, + headline6: headline6 ?? title ?? this.headline6, + subtitle1: subtitle1 ?? subhead ?? this.subtitle1, + subtitle2: subtitle2 ?? subtitle ?? this.subtitle2, + bodyText1: bodyText1 ?? body2 ?? this.bodyText1, + bodyText2: bodyText2 ?? body1 ?? this.bodyText2, caption: caption ?? this.caption, button: button ?? this.button, - subtitle: subtitle ?? this.subtitle, 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 /// // useful, so merge it with the existing theme to keep all of the /// // 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)); /// return Theme(data: theme, child: child); /// } @@ -296,18 +528,18 @@ class TextTheme extends Diagnosticable { if (other == null) return this; return copyWith( - display4: display4?.merge(other.display4) ?? other.display4, - display3: display3?.merge(other.display3) ?? other.display3, - display2: display2?.merge(other.display2) ?? other.display2, - display1: display1?.merge(other.display1) ?? other.display1, - headline: headline?.merge(other.headline) ?? other.headline, - title: title?.merge(other.title) ?? other.title, - subhead: subhead?.merge(other.subhead) ?? other.subhead, - body2: body2?.merge(other.body2) ?? other.body2, - body1: body1?.merge(other.body1) ?? other.body1, + headline1: headline1?.merge(other.headline1) ?? other.headline1, + headline2: headline2?.merge(other.headline2) ?? other.headline2, + headline3: headline3?.merge(other.headline3) ?? other.headline3, + headline4: headline4?.merge(other.headline4) ?? other.headline4, + headline5: headline5?.merge(other.headline5) ?? other.headline5, + headline6: headline6?.merge(other.headline6) ?? other.headline6, + subtitle1: subtitle1?.merge(other.subtitle1) ?? other.subtitle1, + subtitle2: subtitle2?.merge(other.subtitle2) ?? other.subtitle2, + bodyText1: bodyText1?.merge(other.bodyText1) ?? other.bodyText1, + bodyText2: bodyText2?.merge(other.bodyText2) ?? other.bodyText2, caption: caption?.merge(other.caption) ?? other.caption, button: button?.merge(other.button) ?? other.button, - subtitle: subtitle?.merge(other.subtitle) ?? other.subtitle, 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 /// each of the individual text styles. /// - /// The `displayColor` is applied to [display4], [display3], [display2], - /// [display1], and [caption]. The `bodyColor` is applied to the remaining + /// The `displayColor` is applied to [headline4], [headline3], [headline2], + /// [headline1], and [caption]. The `bodyColor` is applied to the remaining /// text styles. /// /// Consider using [Typography.black] or [Typography.white], which implement @@ -333,7 +565,7 @@ class TextTheme extends Diagnosticable { TextDecorationStyle decorationStyle, }) { return TextTheme( - display4: display4?.apply( + headline1: headline1?.apply( color: displayColor, decoration: decoration, decorationColor: decorationColor, @@ -342,7 +574,7 @@ class TextTheme extends Diagnosticable { fontSizeFactor: fontSizeFactor, fontSizeDelta: fontSizeDelta, ), - display3: display3?.apply( + headline2: headline2?.apply( color: displayColor, decoration: decoration, decorationColor: decorationColor, @@ -351,7 +583,7 @@ class TextTheme extends Diagnosticable { fontSizeFactor: fontSizeFactor, fontSizeDelta: fontSizeDelta, ), - display2: display2?.apply( + headline3: headline3?.apply( color: displayColor, decoration: decoration, decorationColor: decorationColor, @@ -360,7 +592,7 @@ class TextTheme extends Diagnosticable { fontSizeFactor: fontSizeFactor, fontSizeDelta: fontSizeDelta, ), - display1: display1?.apply( + headline4: headline4?.apply( color: displayColor, decoration: decoration, decorationColor: decorationColor, @@ -369,7 +601,7 @@ class TextTheme extends Diagnosticable { fontSizeFactor: fontSizeFactor, fontSizeDelta: fontSizeDelta, ), - headline: headline?.apply( + headline5: headline5?.apply( color: bodyColor, decoration: decoration, decorationColor: decorationColor, @@ -378,7 +610,7 @@ class TextTheme extends Diagnosticable { fontSizeFactor: fontSizeFactor, fontSizeDelta: fontSizeDelta, ), - title: title?.apply( + headline6: headline6?.apply( color: bodyColor, decoration: decoration, decorationColor: decorationColor, @@ -387,7 +619,7 @@ class TextTheme extends Diagnosticable { fontSizeFactor: fontSizeFactor, fontSizeDelta: fontSizeDelta, ), - subhead: subhead?.apply( + subtitle1: subtitle1?.apply( color: bodyColor, decoration: decoration, decorationColor: decorationColor, @@ -396,7 +628,7 @@ class TextTheme extends Diagnosticable { fontSizeFactor: fontSizeFactor, fontSizeDelta: fontSizeDelta, ), - body2: body2?.apply( + subtitle2: subtitle2?.apply( color: bodyColor, decoration: decoration, decorationColor: decorationColor, @@ -405,7 +637,16 @@ class TextTheme extends Diagnosticable { fontSizeFactor: fontSizeFactor, 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, decoration: decoration, decorationColor: decorationColor, @@ -432,15 +673,6 @@ class TextTheme extends Diagnosticable { fontSizeFactor: fontSizeFactor, fontSizeDelta: fontSizeDelta, ), - subtitle: subtitle?.apply( - color: bodyColor, - decoration: decoration, - decorationColor: decorationColor, - decorationStyle: decorationStyle, - fontFamily: fontFamily, - fontSizeFactor: fontSizeFactor, - fontSizeDelta: fontSizeDelta, - ), overline: overline?.apply( color: bodyColor, decoration: decoration, @@ -459,18 +691,18 @@ class TextTheme extends Diagnosticable { static TextTheme lerp(TextTheme a, TextTheme b, double t) { assert(t != null); return TextTheme( - display4: TextStyle.lerp(a?.display4, b?.display4, t), - display3: TextStyle.lerp(a?.display3, b?.display3, t), - display2: TextStyle.lerp(a?.display2, b?.display2, t), - display1: TextStyle.lerp(a?.display1, b?.display1, t), - headline: TextStyle.lerp(a?.headline, b?.headline, t), - title: TextStyle.lerp(a?.title, b?.title, t), - subhead: TextStyle.lerp(a?.subhead, b?.subhead, t), - body2: TextStyle.lerp(a?.body2, b?.body2, t), - body1: TextStyle.lerp(a?.body1, b?.body1, t), + headline1: TextStyle.lerp(a?.headline1, b?.headline1, t), + headline2: TextStyle.lerp(a?.headline2, b?.headline2, t), + headline3: TextStyle.lerp(a?.headline3, b?.headline3, t), + headline4: TextStyle.lerp(a?.headline4, b?.headline4, t), + headline5: TextStyle.lerp(a?.headline5, b?.headline5, t), + headline6: TextStyle.lerp(a?.headline6, b?.headline6, t), + subtitle1: TextStyle.lerp(a?.subtitle1, b?.subtitle1, t), + subtitle2: TextStyle.lerp(a?.subtitle2, b?.subtitle2, 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), button: TextStyle.lerp(a?.button, b?.button, t), - subtitle: TextStyle.lerp(a?.subtitle, b?.subtitle, t), overline: TextStyle.lerp(a?.overline, b?.overline, t), ); } @@ -482,37 +714,37 @@ class TextTheme extends Diagnosticable { if (other.runtimeType != runtimeType) return false; return other is TextTheme - && other.display4 == display4 - && other.display3 == display3 - && other.display2 == display2 - && other.display1 == display1 - && other.headline == headline - && other.title == title - && other.subhead == subhead - && other.body2 == body2 - && other.body1 == body1 - && other.caption == caption - && other.button == button - && other.subtitle == subtitle - && other.overline == overline; + && headline1 == other.headline1 + && headline2 == other.headline2 + && headline3 == other.headline3 + && headline4 == other.headline4 + && headline5 == other.headline5 + && headline6 == other.headline6 + && subtitle1 == other.subtitle1 + && subtitle2 == other.subtitle2 + && bodyText1 == other.bodyText1 + && bodyText2 == other.bodyText2 + && caption == other.caption + && button == other.button + && overline == other.overline; } @override int get hashCode { // The hashValues() function supports up to 20 arguments. return hashValues( - display4, - display3, - display2, - display1, - headline, - title, - subhead, - body2, - body1, + headline1, + headline2, + headline3, + headline4, + headline5, + headline6, + subtitle1, + subtitle2, + bodyText1, + bodyText2, caption, button, - subtitle, overline, ); } @@ -520,19 +752,19 @@ class TextTheme extends Diagnosticable { @override void debugFillProperties(DiagnosticPropertiesBuilder properties) { super.debugFillProperties(properties); - final TextTheme defaultTheme = Typography(platform: defaultTargetPlatform).black; - properties.add(DiagnosticsProperty('display4', display4, defaultValue: defaultTheme.display4)); - properties.add(DiagnosticsProperty('display3', display3, defaultValue: defaultTheme.display3)); - properties.add(DiagnosticsProperty('display2', display2, defaultValue: defaultTheme.display2)); - properties.add(DiagnosticsProperty('display1', display1, defaultValue: defaultTheme.display1)); - properties.add(DiagnosticsProperty('headline', headline, defaultValue: defaultTheme.headline)); - properties.add(DiagnosticsProperty('title', title, defaultValue: defaultTheme.title)); - properties.add(DiagnosticsProperty('subhead', subhead, defaultValue: defaultTheme.subhead)); - properties.add(DiagnosticsProperty('body2', body2, defaultValue: defaultTheme.body2)); - properties.add(DiagnosticsProperty('body1', body1, defaultValue: defaultTheme.body1)); + final TextTheme defaultTheme = Typography.material2018(platform: defaultTargetPlatform).black; + properties.add(DiagnosticsProperty('headline1', headline1, defaultValue: defaultTheme.headline1)); + properties.add(DiagnosticsProperty('headline2', headline2, defaultValue: defaultTheme.headline2)); + properties.add(DiagnosticsProperty('headline3', headline3, defaultValue: defaultTheme.headline3)); + properties.add(DiagnosticsProperty('headline4', headline4, defaultValue: defaultTheme.headline4)); + properties.add(DiagnosticsProperty('headline5', headline5, defaultValue: defaultTheme.headline5)); + properties.add(DiagnosticsProperty('headline6', headline6, defaultValue: defaultTheme.headline6)); + properties.add(DiagnosticsProperty('subtitle1', subtitle1, defaultValue: defaultTheme.subtitle1)); + properties.add(DiagnosticsProperty('subtitle2', subtitle2, defaultValue: defaultTheme.subtitle2)); + properties.add(DiagnosticsProperty('bodyText1', bodyText1, defaultValue: defaultTheme.bodyText1)); + properties.add(DiagnosticsProperty('bodyText2', bodyText2, defaultValue: defaultTheme.bodyText2)); properties.add(DiagnosticsProperty('caption', caption, defaultValue: defaultTheme.caption)); properties.add(DiagnosticsProperty('button', button, defaultValue: defaultTheme.button)); - properties.add(DiagnosticsProperty('subtitle)', subtitle, defaultValue: defaultTheme.subtitle)); properties.add(DiagnosticsProperty('overline', overline, defaultValue: defaultTheme.overline)); } } diff --git a/packages/flutter/lib/src/material/theme.dart b/packages/flutter/lib/src/material/theme.dart index 9c2c9229ac3..af351520e38 100644 --- a/packages/flutter/lib/src/material/theme.dart +++ b/packages/flutter/lib/src/material/theme.dart @@ -92,7 +92,7 @@ class Theme extends StatelessWidget { /// Widget build(BuildContext context) { /// return Text( /// 'Example', - /// style: Theme.of(context).textTheme.title, + /// style: Theme.of(context).textTheme.headline6, /// ); /// } /// ``` @@ -116,7 +116,7 @@ class Theme extends StatelessWidget { /// return Center( /// child: Text( /// 'Example', - /// style: Theme.of(context).textTheme.title, + /// style: Theme.of(context).textTheme.headline6, /// ), /// ); /// }, diff --git a/packages/flutter/lib/src/material/theme_data.dart b/packages/flutter/lib/src/material/theme_data.dart index 7e7079fe64e..4eef2222ce4 100644 --- a/packages/flutter/lib/src/material/theme_data.dart +++ b/packages/flutter/lib/src/material/theme_data.dart @@ -133,7 +133,7 @@ enum MaterialTapTargetSize { /// This sample creates a [MaterialApp] widget that stores `ThemeData` and /// passes the `ThemeData` to descendant widgets. The [AppBar] 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. /// /// ![](https://flutter.github.io/assets-for-api-docs/assets/material/material_app_theme_data.png) @@ -143,7 +143,7 @@ enum MaterialTapTargetSize { /// theme: ThemeData( /// primaryColor: Colors.blue, /// accentColor: Colors.green, -/// textTheme: TextTheme(body1: TextStyle(color: Colors.purple)), +/// textTheme: TextTheme(bodyText2: TextStyle(color: Colors.purple)), /// ), /// home: Scaffold( /// appBar: AppBar( @@ -316,7 +316,7 @@ class ThemeData extends Diagnosticable { accentIconTheme ??= accentIsDark ? const IconThemeData(color: Colors.white) : const IconThemeData(color: Colors.black); iconTheme ??= isDark ? const IconThemeData(color: Colors.white) : const IconThemeData(color: Colors.black87); platform ??= defaultTargetPlatform; - typography ??= Typography(platform: platform); + typography ??= Typography.material2014(platform: platform); TextTheme defaultTextTheme = isDark ? typography.white : typography.black; TextTheme defaultPrimaryTextTheme = primaryIsDark ? typography.white : typography.black; TextTheme defaultAccentTextTheme = accentIsDark ? typography.white : typography.black; @@ -360,7 +360,7 @@ class ThemeData extends Diagnosticable { chipTheme ??= ChipThemeData.fromDefaults( secondaryColor: primaryColor, brightness: brightness, - labelStyle: textTheme.body2, + labelStyle: textTheme.bodyText1, ); dialogTheme ??= const DialogTheme(); floatingActionButtonTheme ??= const FloatingActionButtonThemeData(); diff --git a/packages/flutter/lib/src/material/time_picker.dart b/packages/flutter/lib/src/material/time_picker.dart index 4ae5d13cd46..f41ebc0479b 100644 --- a/packages/flutter/lib/src/material/time_picker.dart +++ b/packages/flutter/lib/src/material/time_picker.dart @@ -239,10 +239,10 @@ class _DayPeriodControl extends StatelessWidget { final Color activeColor = fragmentContext.activeColor; final Color inactiveColor = fragmentContext.inactiveColor; final bool amSelected = selectedTime.period == DayPeriod.am; - final TextStyle amStyle = headerTextTheme.subhead.copyWith( + final TextStyle amStyle = headerTextTheme.subtitle1.copyWith( color: amSelected ? activeColor: inactiveColor ); - final TextStyle pmStyle = headerTextTheme.subhead.copyWith( + final TextStyle pmStyle = headerTextTheme.subtitle1.copyWith( color: !amSelected ? activeColor: inactiveColor ); final bool layoutPortrait = orientation == Orientation.portrait; @@ -771,9 +771,9 @@ class _TimePickerHeader extends StatelessWidget { assert(orientation != null); switch (orientation) { case Orientation.portrait: - return headerTextTheme.display3.copyWith(fontSize: 60.0); + return headerTextTheme.headline2.copyWith(fontSize: 60.0); case Orientation.landscape: - return headerTextTheme.display2.copyWith(fontSize: 50.0); + return headerTextTheme.headline3.copyWith(fontSize: 50.0); } return null; } @@ -1340,7 +1340,7 @@ class _DialState extends State<_Dial> with SingleTickerProviderStateMixin { ]; _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); return _TappableLabel( value: value, diff --git a/packages/flutter/lib/src/material/toggle_buttons.dart b/packages/flutter/lib/src/material/toggle_buttons.dart index 1e6ea241c38..018613612f9 100644 --- a/packages/flutter/lib/src/material/toggle_buttons.dart +++ b/packages/flutter/lib/src/material/toggle_buttons.dart @@ -800,7 +800,7 @@ class _ToggleButton extends StatelessWidget { 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 Widget result = ClipRRect( diff --git a/packages/flutter/lib/src/material/tooltip.dart b/packages/flutter/lib/src/material/tooltip.dart index 792852d3062..abc9ec32acc 100644 --- a/packages/flutter/lib/src/material/tooltip.dart +++ b/packages/flutter/lib/src/material/tooltip.dart @@ -130,9 +130,9 @@ class Tooltip extends StatefulWidget { /// /// If null, the message's [TextStyle] will be determined based on /// [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], - /// [ThemeData.textTheme.body1] will be used with [Colors.black]. + /// [ThemeData.textTheme.bodyText2] will be used with [Colors.black]. final TextStyle textStyle; /// The length of time that a pointer must hover over a tooltip's widget @@ -362,7 +362,7 @@ class _TooltipState extends State with SingleTickerProviderStateMixin { TextStyle defaultTextStyle; BoxDecoration defaultDecoration; if (theme.brightness == Brightness.dark) { - defaultTextStyle = theme.textTheme.body1.copyWith( + defaultTextStyle = theme.textTheme.bodyText2.copyWith( color: Colors.black, ); defaultDecoration = BoxDecoration( @@ -370,7 +370,7 @@ class _TooltipState extends State with SingleTickerProviderStateMixin { borderRadius: const BorderRadius.all(Radius.circular(4)), ); } else { - defaultTextStyle = theme.textTheme.body1.copyWith( + defaultTextStyle = theme.textTheme.bodyText2.copyWith( color: Colors.white, ); defaultDecoration = BoxDecoration( @@ -504,7 +504,7 @@ class _TooltipOverlay extends StatelessWidget { child: ConstrainedBox( constraints: BoxConstraints(minHeight: height), child: DefaultTextStyle( - style: Theme.of(context).textTheme.body1, + style: Theme.of(context).textTheme.bodyText2, child: Container( decoration: decoration, padding: padding, diff --git a/packages/flutter/lib/src/material/typography.dart b/packages/flutter/lib/src/material/typography.dart index 03ab55081a8..4eb0f48cccf 100644 --- a/packages/flutter/lib/src/material/typography.dart +++ b/packages/flutter/lib/src/material/typography.dart @@ -53,10 +53,12 @@ enum ScriptCategory { /// `Theme.of(context).primaryTextTheme` or /// `Theme.of(context).accentTextTheme`. /// -/// The color text themes are [blackMountainView], -/// [whiteMountainView], and [blackCupertino] and [whiteCupertino]. The -/// Mountain View theme [TextStyles] are based on the Roboto fonts and the -/// Cupertino themes are based on the San Francisco fonts. +/// The color text themes are [blackMountainView], [whiteMountainView], +/// [blackCupertino], and [whiteCupertino]. The Mountain View theme [TextStyles] +/// are based on the Roboto fonts as used on Android. The Cupertino themes are +/// 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 /// 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 /// letter spacing values. /// -/// By default, [ThemeData.typography] is -/// `Typography(platform: platform)` which uses [englishLike2014], -/// [dense2014] and [tall2014]. To use the 2018 text theme -/// geometries, specify a typography value: +/// By default, [ThemeData.typography] is `Typography.material2014(platform: +/// platform)` which uses [englishLike2014], [dense2014] and [tall2014]. To use +/// the 2018 text theme geometries, specify a value using the [material2018] +/// constructor: /// /// ```dart -/// Typography( -/// platorm: platform, -/// englishLike: Typography.englishLike2018, -/// dense: Typography.dense2018, -/// tall: Typography.tall2018, -/// ) +/// typography: Typography.material2018(platform: platform) /// ``` /// /// See also: @@ -88,6 +85,27 @@ enum ScriptCategory { class Typography extends Diagnosticable { /// 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 /// default values for [black] and [white] are [blackCupertino] 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 /// [englishLike2014], [dense2014], and [tall2014]. - factory Typography({ + factory Typography.material2014({ TargetPlatform platform = TargetPlatform.android, TextTheme black, TextTheme white, @@ -105,6 +123,55 @@ class Typography extends Diagnosticable { TextTheme tall, }) { 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) { case TargetPlatform.iOS: case TargetPlatform.macOS: @@ -116,9 +183,6 @@ class Typography extends Diagnosticable { black ??= blackMountainView; white ??= whiteMountainView; } - englishLike ??= englishLike2014; - dense ??= dense2014; - tall ??= tall2014; return Typography._(black, white, englishLike, dense, tall); } @@ -206,12 +270,12 @@ class Typography extends Diagnosticable { TextTheme dense, TextTheme tall, }) { - return Typography( - black: black ?? this.black, - white: white ?? this.white, - englishLike: englishLike ?? this.englishLike, - dense: dense ?? this.dense, - tall: tall ?? this.tall, + return Typography._( + black ?? this.black, + white ?? this.white, + englishLike ?? this.englishLike, + dense ?? this.dense, + tall ?? this.tall, ); } @@ -219,12 +283,12 @@ class Typography extends Diagnosticable { /// /// {@macro dart.ui.shadow.lerp} static Typography lerp(Typography a, Typography b, double t) { - return Typography( - black: TextTheme.lerp(a.black, b.black, t), - white: TextTheme.lerp(a.white, b.white, t), - englishLike: TextTheme.lerp(a.englishLike, b.englishLike, t), - dense: TextTheme.lerp(a.dense, b.dense, t), - tall: TextTheme.lerp(a.tall, b.tall, t), + return Typography._( + TextTheme.lerp(a.black, b.black, t), + TextTheme.lerp(a.white, b.white, t), + TextTheme.lerp(a.englishLike, b.englishLike, t), + TextTheme.lerp(a.dense, b.dense, t), + TextTheme.lerp(a.tall, b.tall, t), ); } @@ -256,7 +320,7 @@ class Typography extends Diagnosticable { @override void debugFillProperties(DiagnosticPropertiesBuilder properties) { super.debugFillProperties(properties); - final Typography defaultTypography = Typography(); + final Typography defaultTypography = Typography.material2014(); properties.add(DiagnosticsProperty('black', black, defaultValue: defaultTypography.black)); properties.add(DiagnosticsProperty('white', white, defaultValue: defaultTypography.white)); properties.add(DiagnosticsProperty('englishLike', englishLike, defaultValue: defaultTypography.englishLike)); @@ -268,94 +332,94 @@ class Typography extends Diagnosticable { /// /// This [TextTheme] provides color but not geometry (font size, weight, etc). static const TextTheme blackMountainView = TextTheme( - display4 : TextStyle(debugLabel: 'blackMountainView display4', 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), - display2 : TextStyle(debugLabel: 'blackMountainView display2', 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), - headline : TextStyle(debugLabel: 'blackMountainView headline', 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), - subhead : TextStyle(debugLabel: 'blackMountainView subhead', 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), - body1 : TextStyle(debugLabel: 'blackMountainView body1', 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), - button : TextStyle(debugLabel: 'blackMountainView button', fontFamily: 'Roboto', inherit: true, color: Colors.black87, decoration: TextDecoration.none), - subtitle : TextStyle(debugLabel: 'blackMountainView subtitle', 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), + headline1 : TextStyle(debugLabel: 'blackMountainView headline1', 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), + headline3 : TextStyle(debugLabel: 'blackMountainView headline3', 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), + headline5 : TextStyle(debugLabel: 'blackMountainView headline5', 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), + bodyText1 : TextStyle(debugLabel: 'blackMountainView bodyText1', 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), + subtitle1 : TextStyle(debugLabel: 'blackMountainView subtitle1', fontFamily: 'Roboto', inherit: true, color: Colors.black87, decoration: TextDecoration.none), + subtitle2 : TextStyle(debugLabel: 'blackMountainView subtitle2', fontFamily: 'Roboto', inherit: true, color: Colors.black, decoration: TextDecoration.none), + caption : TextStyle(debugLabel: 'blackMountainView caption', fontFamily: 'Roboto', inherit: true, color: Colors.black54, 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), ); /// A material design text theme with light glyphs based on Roboto. /// /// This [TextTheme] provides color but not geometry (font size, weight, etc). static const TextTheme whiteMountainView = TextTheme( - display4 : TextStyle(debugLabel: 'whiteMountainView display4', 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), - display2 : TextStyle(debugLabel: 'whiteMountainView display2', 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), - headline : TextStyle(debugLabel: 'whiteMountainView headline', 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), - subhead : TextStyle(debugLabel: 'whiteMountainView subhead', 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), - body1 : TextStyle(debugLabel: 'whiteMountainView body1', 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), - button : TextStyle(debugLabel: 'whiteMountainView button', fontFamily: 'Roboto', inherit: true, color: Colors.white, decoration: TextDecoration.none), - subtitle : TextStyle(debugLabel: 'whiteMountainView subtitle', 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), + headline1 : TextStyle(debugLabel: 'whiteMountainView headline1', 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), + headline3 : TextStyle(debugLabel: 'whiteMountainView headline3', 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), + headline5 : TextStyle(debugLabel: 'whiteMountainView headline5', 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), + bodyText1 : TextStyle(debugLabel: 'whiteMountainView bodyText1', 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), + subtitle1 : TextStyle(debugLabel: 'whiteMountainView subtitle1', fontFamily: 'Roboto', inherit: true, color: Colors.white, decoration: TextDecoration.none), + subtitle2 : TextStyle(debugLabel: 'whiteMountainView subtitle2', 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), + 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), ); /// A material design text theme with dark glyphs based on San Francisco. /// /// This [TextTheme] provides color but not geometry (font size, weight, etc). static const TextTheme blackCupertino = TextTheme( - display4 : TextStyle(debugLabel: 'blackCupertino display4', 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), - display2 : TextStyle(debugLabel: 'blackCupertino display2', 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), - headline : TextStyle(debugLabel: 'blackCupertino headline', 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), - subhead : TextStyle(debugLabel: 'blackCupertino subhead', 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), - body1 : TextStyle(debugLabel: 'blackCupertino body1', 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), - button : TextStyle(debugLabel: 'blackCupertino button', fontFamily: '.SF UI Text', inherit: true, color: Colors.black87, decoration: TextDecoration.none), - subtitle : TextStyle(debugLabel: 'blackCupertino subtitle', 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), + headline1 : TextStyle(debugLabel: 'blackCupertino headline1', 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), + headline3 : TextStyle(debugLabel: 'blackCupertino headline3', 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), + headline5 : TextStyle(debugLabel: 'blackCupertino headline5', 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), + bodyText1 : TextStyle(debugLabel: 'blackCupertino bodyText1', 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), + subtitle1 : TextStyle(debugLabel: 'blackCupertino subtitle1', fontFamily: '.SF UI Text', inherit: true, color: Colors.black87, decoration: TextDecoration.none), + subtitle2 : TextStyle(debugLabel: 'blackCupertino subtitle2', fontFamily: '.SF UI Text', inherit: true, color: Colors.black, decoration: TextDecoration.none), + caption : TextStyle(debugLabel: 'blackCupertino caption', fontFamily: '.SF UI Text', inherit: true, color: Colors.black54, 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), ); /// A material design text theme with light glyphs based on San Francisco. /// /// This [TextTheme] provides color but not geometry (font size, weight, etc). static const TextTheme whiteCupertino = TextTheme( - display4 : TextStyle(debugLabel: 'whiteCupertino display4', 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), - display2 : TextStyle(debugLabel: 'whiteCupertino display2', 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), - headline : TextStyle(debugLabel: 'whiteCupertino headline', 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), - subhead : TextStyle(debugLabel: 'whiteCupertino subhead', 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), - body1 : TextStyle(debugLabel: 'whiteCupertino body1', 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), - 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), - overline : TextStyle(debugLabel: 'whiteCupertino overline', fontFamily: '.SF UI Text', inherit: true, color: Colors.white, decoration: TextDecoration.none), + headline1 : TextStyle(debugLabel: 'whiteCupertino headline1', 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), + headline3 : TextStyle(debugLabel: 'whiteCupertino headline3', 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), + headline5 : TextStyle(debugLabel: 'whiteCupertino headline5', 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), + subtitle1 : TextStyle(debugLabel: 'whiteCupertino subtitle1', 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), + 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), + button : TextStyle(debugLabel: 'whiteCupertino button', 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), ); /// Defines text geometry for [ScriptCategory.englishLike] scripts, such as /// English, French, Russian, etc. static const TextTheme englishLike2014 = TextTheme( - display4 : 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), - display2 : 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), - headline : 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), - subhead : TextStyle(debugLabel: 'englishLike subhead 2014', inherit: false, fontSize: 16.0, fontWeight: FontWeight.w400, textBaseline: TextBaseline.alphabetic), - body2 : TextStyle(debugLabel: 'englishLike body2 2014', inherit: false, fontSize: 14.0, fontWeight: FontWeight.w500, textBaseline: TextBaseline.alphabetic), - body1 : TextStyle(debugLabel: 'englishLike body1 2014', inherit: false, fontSize: 14.0, fontWeight: FontWeight.w400, textBaseline: TextBaseline.alphabetic), - caption : TextStyle(debugLabel: 'englishLike caption 2014', inherit: false, fontSize: 12.0, fontWeight: FontWeight.w400, textBaseline: TextBaseline.alphabetic), - button : TextStyle(debugLabel: 'englishLike button 2014', inherit: false, fontSize: 14.0, fontWeight: FontWeight.w500, textBaseline: TextBaseline.alphabetic), - subtitle : TextStyle(debugLabel: 'englishLike subtitle 2014', inherit: false, fontSize: 14.0, fontWeight: FontWeight.w500, textBaseline: TextBaseline.alphabetic, letterSpacing: 0.1), - overline : TextStyle(debugLabel: 'englishLike overline 2014', inherit: false, fontSize: 10.0, fontWeight: FontWeight.w400, textBaseline: TextBaseline.alphabetic, letterSpacing: 1.5), + headline1 : TextStyle(debugLabel: 'englishLike display4 2014', inherit: false, fontSize: 112.0, fontWeight: FontWeight.w100, textBaseline: TextBaseline.alphabetic), + headline2 : TextStyle(debugLabel: 'englishLike display3 2014', inherit: false, fontSize: 56.0, fontWeight: FontWeight.w400, textBaseline: TextBaseline.alphabetic), + headline3 : TextStyle(debugLabel: 'englishLike display2 2014', inherit: false, fontSize: 45.0, fontWeight: FontWeight.w400, textBaseline: TextBaseline.alphabetic), + headline4 : TextStyle(debugLabel: 'englishLike display1 2014', inherit: false, fontSize: 34.0, fontWeight: FontWeight.w400, textBaseline: TextBaseline.alphabetic), + headline5 : TextStyle(debugLabel: 'englishLike headline 2014', inherit: false, fontSize: 24.0, fontWeight: FontWeight.w400, textBaseline: TextBaseline.alphabetic), + headline6 : TextStyle(debugLabel: 'englishLike title 2014', inherit: false, fontSize: 20.0, fontWeight: FontWeight.w500, textBaseline: TextBaseline.alphabetic), + bodyText1 : 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), + subtitle1 : TextStyle(debugLabel: 'englishLike subhead 2014', inherit: false, fontSize: 16.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), + caption : TextStyle(debugLabel: 'englishLike caption 2014', inherit: false, fontSize: 12.0, fontWeight: FontWeight.w400, textBaseline: TextBaseline.alphabetic), + 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), ); /// 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 /// [latest Material Design specification](https://material.io/go/design-typography#typography-styles). static const TextTheme englishLike2018 = TextTheme( - display4 : TextStyle(debugLabel: 'englishLike display4 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), - display2 : TextStyle(debugLabel: 'englishLike display2 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), - headline : TextStyle(debugLabel: 'englishLike headline 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), - subhead : TextStyle(debugLabel: 'englishLike subhead 2018', fontSize: 16.0, fontWeight: FontWeight.w400, textBaseline: TextBaseline.alphabetic, letterSpacing: 0.15), - body2 : TextStyle(debugLabel: 'englishLike body2 2018', fontSize: 14.0, fontWeight: FontWeight.w400, textBaseline: TextBaseline.alphabetic, letterSpacing: 0.25), - body1 : TextStyle(debugLabel: 'englishLike body1 2018', fontSize: 16.0, fontWeight: FontWeight.w400, textBaseline: TextBaseline.alphabetic, letterSpacing: 0.5), - button : TextStyle(debugLabel: 'englishLike button 2018', fontSize: 14.0, fontWeight: FontWeight.w500, textBaseline: TextBaseline.alphabetic, letterSpacing: 0.75), - caption : TextStyle(debugLabel: 'englishLike caption 2018', fontSize: 12.0, fontWeight: FontWeight.w400, textBaseline: TextBaseline.alphabetic, letterSpacing: 0.4), - subtitle : TextStyle(debugLabel: 'englishLike subtitle 2018', fontSize: 14.0, fontWeight: FontWeight.w500, textBaseline: TextBaseline.alphabetic, letterSpacing: 0.1), - overline : TextStyle(debugLabel: 'englishLike overline 2018', fontSize: 10.0, fontWeight: FontWeight.w400, textBaseline: TextBaseline.alphabetic, letterSpacing: 1.5), + headline1 : TextStyle(debugLabel: 'englishLike headline1 2018', fontSize: 96.0, fontWeight: FontWeight.w300, textBaseline: TextBaseline.alphabetic, letterSpacing: -1.5), + headline2 : TextStyle(debugLabel: 'englishLike headline2 2018', fontSize: 60.0, fontWeight: FontWeight.w300, textBaseline: TextBaseline.alphabetic, letterSpacing: -0.5), + headline3 : TextStyle(debugLabel: 'englishLike headline3 2018', fontSize: 48.0, fontWeight: FontWeight.w400, textBaseline: TextBaseline.alphabetic, letterSpacing: 0.0), + headline4 : TextStyle(debugLabel: 'englishLike headline4 2018', fontSize: 34.0, fontWeight: FontWeight.w400, textBaseline: TextBaseline.alphabetic, letterSpacing: 0.25), + headline5 : TextStyle(debugLabel: 'englishLike headline5 2018', fontSize: 24.0, fontWeight: FontWeight.w400, textBaseline: TextBaseline.alphabetic, letterSpacing: 0.0), + headline6 : TextStyle(debugLabel: 'englishLike headline6 2018', fontSize: 20.0, fontWeight: FontWeight.w500, textBaseline: TextBaseline.alphabetic, letterSpacing: 0.15), + bodyText1 : TextStyle(debugLabel: 'englishLike bodyText1 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), + subtitle1 : TextStyle(debugLabel: 'englishLike subtitle1 2018', fontSize: 16.0, fontWeight: FontWeight.w400, textBaseline: TextBaseline.alphabetic, letterSpacing: 0.15), + subtitle2 : TextStyle(debugLabel: 'englishLike subtitle2 2018', fontSize: 14.0, fontWeight: FontWeight.w500, textBaseline: TextBaseline.alphabetic, letterSpacing: 0.1), + button : TextStyle(debugLabel: 'englishLike button 2018', fontSize: 14.0, fontWeight: FontWeight.w500, textBaseline: TextBaseline.alphabetic, letterSpacing: 0.75), + 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), ); /// Defines text geometry for dense scripts, such as Chinese, Japanese /// and Korean. static const TextTheme dense2014 = TextTheme( - display4 : 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), - display2 : 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), - headline : 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), - subhead : TextStyle(debugLabel: 'dense subhead 2014', inherit: false, fontSize: 17.0, fontWeight: FontWeight.w400, textBaseline: TextBaseline.ideographic), - body2 : TextStyle(debugLabel: 'dense body2 2014', inherit: false, fontSize: 15.0, fontWeight: FontWeight.w500, textBaseline: TextBaseline.ideographic), - body1 : TextStyle(debugLabel: 'dense body1 2014', inherit: false, fontSize: 15.0, fontWeight: FontWeight.w400, textBaseline: TextBaseline.ideographic), - caption : TextStyle(debugLabel: 'dense caption 2014', inherit: false, fontSize: 13.0, fontWeight: FontWeight.w400, textBaseline: TextBaseline.ideographic), - button : TextStyle(debugLabel: 'dense button 2014', inherit: false, fontSize: 15.0, fontWeight: FontWeight.w500, textBaseline: TextBaseline.ideographic), - subtitle : TextStyle(debugLabel: 'dense subtitle 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), + headline1 : TextStyle(debugLabel: 'dense display4 2014', inherit: false, fontSize: 112.0, fontWeight: FontWeight.w100, textBaseline: TextBaseline.ideographic), + headline2 : TextStyle(debugLabel: 'dense display3 2014', inherit: false, fontSize: 56.0, fontWeight: FontWeight.w400, textBaseline: TextBaseline.ideographic), + headline3 : TextStyle(debugLabel: 'dense display2 2014', inherit: false, fontSize: 45.0, fontWeight: FontWeight.w400, textBaseline: TextBaseline.ideographic), + headline4 : TextStyle(debugLabel: 'dense display1 2014', inherit: false, fontSize: 34.0, fontWeight: FontWeight.w400, textBaseline: TextBaseline.ideographic), + headline5 : TextStyle(debugLabel: 'dense headline 2014', inherit: false, fontSize: 24.0, fontWeight: FontWeight.w400, textBaseline: TextBaseline.ideographic), + headline6 : TextStyle(debugLabel: 'dense title 2014', inherit: false, fontSize: 21.0, fontWeight: FontWeight.w500, textBaseline: TextBaseline.ideographic), + bodyText1 : 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), + subtitle1 : TextStyle(debugLabel: 'dense subhead 2014', inherit: false, fontSize: 17.0, fontWeight: FontWeight.w400, textBaseline: TextBaseline.ideographic), + subtitle2 : TextStyle(debugLabel: 'dense subtitle 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), + 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), ); /// 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 /// latest [Material Design specification](https://material.io/go/design-typography#typography-styles). static const TextTheme dense2018 = TextTheme( - display4 : TextStyle(debugLabel: 'dense display4 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), - display2 : TextStyle(debugLabel: 'dense display2 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), - headline : TextStyle(debugLabel: 'dense headline 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), - subhead : TextStyle(debugLabel: 'dense subhead 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), - body1 : TextStyle(debugLabel: 'dense body1 2018', fontSize: 15.0, fontWeight: FontWeight.w400, textBaseline: TextBaseline.ideographic), - caption : TextStyle(debugLabel: 'dense caption 2018', fontSize: 13.0, fontWeight: FontWeight.w400, textBaseline: TextBaseline.ideographic), + headline1 : TextStyle(debugLabel: 'dense headline1 2018', fontSize: 96.0, fontWeight: FontWeight.w100, textBaseline: TextBaseline.ideographic), + headline2 : TextStyle(debugLabel: 'dense headline2 2018', fontSize: 60.0, fontWeight: FontWeight.w100, textBaseline: TextBaseline.ideographic), + headline3 : TextStyle(debugLabel: 'dense headline3 2018', fontSize: 48.0, fontWeight: FontWeight.w400, textBaseline: TextBaseline.ideographic), + headline4 : TextStyle(debugLabel: 'dense headline4 2018', fontSize: 34.0, fontWeight: FontWeight.w400, textBaseline: TextBaseline.ideographic), + headline5 : TextStyle(debugLabel: 'dense headline5 2018', fontSize: 24.0, fontWeight: FontWeight.w400, textBaseline: TextBaseline.ideographic), + headline6 : TextStyle(debugLabel: 'dense headline6 2018', fontSize: 21.0, fontWeight: FontWeight.w500, textBaseline: TextBaseline.ideographic), + bodyText1 : TextStyle(debugLabel: 'dense bodyText1 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), + subtitle1 : TextStyle(debugLabel: 'dense subtitle1 2018', fontSize: 17.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), - 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), ); /// Defines text geometry for tall scripts, such as Farsi, Hindi, and Thai. static const TextTheme tall2014 = TextTheme( - display4 : 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), - display2 : 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), - headline : 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), - subhead : TextStyle(debugLabel: 'tall subhead 2014', inherit: false, fontSize: 17.0, fontWeight: FontWeight.w400, textBaseline: TextBaseline.alphabetic), - body2 : TextStyle(debugLabel: 'tall body2 2014', inherit: false, fontSize: 15.0, fontWeight: FontWeight.w700, textBaseline: TextBaseline.alphabetic), - body1 : TextStyle(debugLabel: 'tall body1 2014', inherit: false, fontSize: 15.0, fontWeight: FontWeight.w400, textBaseline: TextBaseline.alphabetic), - caption : TextStyle(debugLabel: 'tall caption 2014', inherit: false, fontSize: 13.0, fontWeight: FontWeight.w400, textBaseline: TextBaseline.alphabetic), - button : TextStyle(debugLabel: 'tall button 2014', inherit: false, fontSize: 15.0, fontWeight: FontWeight.w700, textBaseline: TextBaseline.alphabetic), - subtitle : TextStyle(debugLabel: 'tall subtitle 2014', inherit: false, fontSize: 15.0, fontWeight: FontWeight.w500, textBaseline: TextBaseline.alphabetic), - overline : TextStyle(debugLabel: 'tall overline 2014', inherit: false, fontSize: 11.0, fontWeight: FontWeight.w400, textBaseline: TextBaseline.alphabetic), + headline1 : TextStyle(debugLabel: 'tall display4 2014', inherit: false, fontSize: 112.0, fontWeight: FontWeight.w400, textBaseline: TextBaseline.alphabetic), + headline2 : TextStyle(debugLabel: 'tall display3 2014', inherit: false, fontSize: 56.0, fontWeight: FontWeight.w400, textBaseline: TextBaseline.alphabetic), + headline3 : TextStyle(debugLabel: 'tall display2 2014', inherit: false, fontSize: 45.0, fontWeight: FontWeight.w400, textBaseline: TextBaseline.alphabetic), + headline4 : TextStyle(debugLabel: 'tall display1 2014', inherit: false, fontSize: 34.0, fontWeight: FontWeight.w400, textBaseline: TextBaseline.alphabetic), + headline5 : TextStyle(debugLabel: 'tall headline 2014', inherit: false, fontSize: 24.0, fontWeight: FontWeight.w400, textBaseline: TextBaseline.alphabetic), + headline6 : TextStyle(debugLabel: 'tall title 2014', inherit: false, fontSize: 21.0, fontWeight: FontWeight.w700, textBaseline: TextBaseline.alphabetic), + bodyText1 : 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), + subtitle1 : TextStyle(debugLabel: 'tall subhead 2014', inherit: false, fontSize: 17.0, fontWeight: FontWeight.w400, textBaseline: TextBaseline.alphabetic), + subtitle2 : TextStyle(debugLabel: 'tall subtitle 2014', inherit: false, fontSize: 15.0, fontWeight: FontWeight.w500, textBaseline: TextBaseline.alphabetic), + caption : TextStyle(debugLabel: 'tall caption 2014', inherit: false, fontSize: 13.0, fontWeight: FontWeight.w400, 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), ); /// 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 /// latest [Material Design specification](https://material.io/go/design-typography#typography-styles). static const TextTheme tall2018 = TextTheme( - display4 : TextStyle(debugLabel: 'tall display4 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), - display2 : TextStyle(debugLabel: 'tall display2 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), - headline : TextStyle(debugLabel: 'tall headline 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), - subhead : TextStyle(debugLabel: 'tall subhead 2018', fontSize: 17.0, fontWeight: FontWeight.w400, textBaseline: TextBaseline.alphabetic), - body2 : TextStyle(debugLabel: 'tall body2 2018', fontSize: 17.0, fontWeight: FontWeight.w700, textBaseline: TextBaseline.alphabetic), - body1 : TextStyle(debugLabel: 'tall body1 2018', fontSize: 15.0, fontWeight: FontWeight.w400, textBaseline: TextBaseline.alphabetic), + headline1 : TextStyle(debugLabel: 'tall headline1 2018', fontSize: 96.0, fontWeight: FontWeight.w400, textBaseline: TextBaseline.alphabetic), + headline2 : TextStyle(debugLabel: 'tall headline2 2018', fontSize: 60.0, fontWeight: FontWeight.w400, textBaseline: TextBaseline.alphabetic), + headline3 : TextStyle(debugLabel: 'tall headline3 2018', fontSize: 48.0, fontWeight: FontWeight.w400, textBaseline: TextBaseline.alphabetic), + headline4 : TextStyle(debugLabel: 'tall headline4 2018', fontSize: 34.0, fontWeight: FontWeight.w400, textBaseline: TextBaseline.alphabetic), + headline5 : TextStyle(debugLabel: 'tall headline5 2018', fontSize: 24.0, fontWeight: FontWeight.w400, textBaseline: TextBaseline.alphabetic), + headline6 : TextStyle(debugLabel: 'tall headline6 2018', fontSize: 21.0, fontWeight: FontWeight.w700, textBaseline: TextBaseline.alphabetic), + bodyText1 : TextStyle(debugLabel: 'tall bodyText1 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), + 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), 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), ); } diff --git a/packages/flutter/lib/src/material/user_accounts_drawer_header.dart b/packages/flutter/lib/src/material/user_accounts_drawer_header.dart index 13e61e35c50..157a8c0a692 100644 --- a/packages/flutter/lib/src/material/user_accounts_drawer_header.dart +++ b/packages/flutter/lib/src/material/user_accounts_drawer_header.dart @@ -147,7 +147,7 @@ class _AccountDetailsState extends State<_AccountDetails> with SingleTickerProvi child: Padding( padding: const EdgeInsets.symmetric(vertical: 2.0), child: DefaultTextStyle( - style: theme.primaryTextTheme.body2, + style: theme.primaryTextTheme.bodyText1, overflow: TextOverflow.ellipsis, child: widget.accountName, ), @@ -159,7 +159,7 @@ class _AccountDetailsState extends State<_AccountDetails> with SingleTickerProvi child: Padding( padding: const EdgeInsets.symmetric(vertical: 2.0), child: DefaultTextStyle( - style: theme.primaryTextTheme.body1, + style: theme.primaryTextTheme.bodyText2, overflow: TextOverflow.ellipsis, child: widget.accountEmail, ), diff --git a/packages/flutter/lib/src/services/keyboard_key.dart b/packages/flutter/lib/src/services/keyboard_key.dart index 3b95679e843..09805906f26 100644 --- a/packages/flutter/lib/src/services/keyboard_key.dart +++ b/packages/flutter/lib/src/services/keyboard_key.dart @@ -91,7 +91,7 @@ abstract class KeyboardKey extends Diagnosticable { /// color: Colors.white, /// alignment: Alignment.center, /// child: DefaultTextStyle( -/// style: textTheme.display1, +/// style: textTheme.headline4, /// child: RawKeyboardListener( /// focusNode: _focusNode, /// onKey: _handleKeyEvent, @@ -2000,7 +2000,7 @@ class LogicalKeyboardKey extends KeyboardKey { /// color: Colors.white, /// alignment: Alignment.center, /// child: DefaultTextStyle( -/// style: textTheme.display1, +/// style: textTheme.headline4, /// child: RawKeyboardListener( /// focusNode: _focusNode, /// onKey: _handleKeyEvent, diff --git a/packages/flutter/lib/src/widgets/animated_list.dart b/packages/flutter/lib/src/widgets/animated_list.dart index 1db9baf5897..bdcec6f4f58 100644 --- a/packages/flutter/lib/src/widgets/animated_list.dart +++ b/packages/flutter/lib/src/widgets/animated_list.dart @@ -229,7 +229,7 @@ class _ActiveItem implements Comparable<_ActiveItem> { /// /// @override /// Widget build(BuildContext context) { -/// TextStyle textStyle = Theme.of(context).textTheme.display1; +/// TextStyle textStyle = Theme.of(context).textTheme.headline4; /// if (selected) /// textStyle = textStyle.copyWith(color: Colors.lightGreenAccent[400]); /// return Padding( @@ -712,7 +712,7 @@ class AnimatedListState extends State with TickerProviderStateMixi /// child: Center( /// child: Text( /// 'Item $item', -/// style: Theme.of(context).textTheme.display1, +/// style: Theme.of(context).textTheme.headline4, /// ), /// ), /// ), diff --git a/packages/flutter/lib/src/widgets/animated_switcher.dart b/packages/flutter/lib/src/widgets/animated_switcher.dart index abb009fb86f..a806e8eca7b 100644 --- a/packages/flutter/lib/src/widgets/animated_switcher.dart +++ b/packages/flutter/lib/src/widgets/animated_switcher.dart @@ -118,7 +118,7 @@ typedef AnimatedSwitcherLayoutBuilder = Widget Function(Widget currentChild, Lis /// // child each time the count changes, so that it will begin its animation /// // when the count changes. /// key: ValueKey(_count), -/// style: Theme.of(context).textTheme.display1, +/// style: Theme.of(context).textTheme.headline4, /// ), /// ), /// RaisedButton( diff --git a/packages/flutter/lib/src/widgets/basic.dart b/packages/flutter/lib/src/widgets/basic.dart index 2ecaf787074..56981dafcfb 100644 --- a/packages/flutter/lib/src/widgets/basic.dart +++ b/packages/flutter/lib/src/widgets/basic.dart @@ -5585,7 +5585,7 @@ class WidgetToRenderBoxAdapter extends LeafRenderObjectWidget { /// Text('You have pressed or released in this area this many times:'), /// Text( /// '$_downCounter presses\n$_upCounter releases', -/// style: Theme.of(context).textTheme.display1, +/// style: Theme.of(context).textTheme.headline4, /// ), /// Text( /// '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( /// '$_enterCounter Entries\n$_exitCounter Exits', -/// style: Theme.of(context).textTheme.display1, +/// style: Theme.of(context).textTheme.headline4, /// ), /// Text( /// 'The cursor is here: (${x.toStringAsFixed(2)}, ${y.toStringAsFixed(2)})', diff --git a/packages/flutter/lib/src/widgets/container.dart b/packages/flutter/lib/src/widgets/container.dart index 472a092d707..8949bea485b 100644 --- a/packages/flutter/lib/src/widgets/container.dart +++ b/packages/flutter/lib/src/widgets/container.dart @@ -266,7 +266,7 @@ class DecoratedBox extends SingleChildRenderObjectWidget { /// ```dart /// Container( /// 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), /// color: Colors.blue[600], @@ -274,7 +274,7 @@ class DecoratedBox extends SingleChildRenderObjectWidget { /// child: Text('Hello World', /// style: Theme.of(context) /// .textTheme -/// .display1 +/// .headline4 /// .copyWith(color: Colors.white)), /// transform: Matrix4.rotationZ(0.1), /// ) diff --git a/packages/flutter/lib/src/widgets/focus_manager.dart b/packages/flutter/lib/src/widgets/focus_manager.dart index a5dede7da6c..fd78e74fd7e 100644 --- a/packages/flutter/lib/src/widgets/focus_manager.dart +++ b/packages/flutter/lib/src/widgets/focus_manager.dart @@ -342,7 +342,7 @@ class FocusAttachment { /// Widget build(BuildContext context) { /// final TextTheme textTheme = Theme.of(context).textTheme; /// return DefaultTextStyle( -/// style: textTheme.display1, +/// style: textTheme.headline4, /// child: ColorfulButton(), /// ); /// } diff --git a/packages/flutter/lib/src/widgets/focus_scope.dart b/packages/flutter/lib/src/widgets/focus_scope.dart index 3714fa54e95..b9f60779af1 100644 --- a/packages/flutter/lib/src/widgets/focus_scope.dart +++ b/packages/flutter/lib/src/widgets/focus_scope.dart @@ -83,7 +83,7 @@ import 'inherited_notifier.dart'; /// debugLabel: 'Scope', /// autofocus: true, /// child: DefaultTextStyle( -/// style: textTheme.display1, +/// style: textTheme.headline4, /// child: Focus( /// onKey: _handleKeyPress, /// debugLabel: 'Button', diff --git a/packages/flutter/lib/src/widgets/navigator.dart b/packages/flutter/lib/src/widgets/navigator.dart index e624cc5bc90..e18e3b7c231 100644 --- a/packages/flutter/lib/src/widgets/navigator.dart +++ b/packages/flutter/lib/src/widgets/navigator.dart @@ -663,7 +663,7 @@ class NavigatorObserver { /// @override /// Widget build(BuildContext context) { /// return DefaultTextStyle( -/// style: Theme.of(context).textTheme.display1, +/// style: Theme.of(context).textTheme.headline4, /// child: Container( /// color: Colors.white, /// alignment: Alignment.center, @@ -677,7 +677,7 @@ class NavigatorObserver { /// @override /// Widget build(BuildContext context) { /// return DefaultTextStyle( -/// style: Theme.of(context).textTheme.display1, +/// style: Theme.of(context).textTheme.headline4, /// child: GestureDetector( /// onTap: () { /// // This moves from the personal info page to the credentials page, @@ -707,7 +707,7 @@ class NavigatorObserver { /// return GestureDetector( /// onTap: onSignupComplete, /// child: DefaultTextStyle( -/// style: Theme.of(context).textTheme.display1, +/// style: Theme.of(context).textTheme.headline4, /// child: Container( /// color: Colors.pinkAccent, /// alignment: Alignment.center, diff --git a/packages/flutter/test/material/app_bar_theme_test.dart b/packages/flutter/test/material/app_bar_theme_test.dart index 77ff397bfca..c04e937c428 100644 --- a/packages/flutter/test/material/app_bar_theme_test.dart +++ b/packages/flutter/test/material/app_bar_theme_test.dart @@ -34,7 +34,7 @@ void main() { expect(iconTheme.data, const IconThemeData(color: Colors.white)); expect(actionsIconTheme.data, const IconThemeData(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 { @@ -62,7 +62,7 @@ void main() { expect(iconTheme.data, appBarTheme.iconTheme); expect(actionsIconTheme.data, appBarTheme.actionsIconTheme); 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 { @@ -71,7 +71,7 @@ void main() { const double elevation = 3.0; const IconThemeData iconThemeData = IconThemeData(color: Colors.green); 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()); @@ -102,7 +102,7 @@ void main() { expect(iconTheme.data, iconThemeData); expect(actionsIconTheme.data, actionsIconThemeData); 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 { @@ -152,7 +152,7 @@ void main() { expect(iconTheme.data, appBarTheme.iconTheme); expect(actionsIconTheme.data, appBarTheme.actionsIconTheme); 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 { @@ -179,7 +179,8 @@ void main() { expect(iconTheme.data, themeData.primaryIconTheme); expect(actionsIconTheme.data, themeData.primaryIconTheme); 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 IconThemeData iconThemeData = IconThemeData(color: Colors.black); 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( actionsIconTheme: actionsIconThemeData, brightness: brightness, @@ -205,7 +206,7 @@ ThemeData _themeData() { primaryColor: Colors.purple, brightness: Brightness.dark, 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)), ); } diff --git a/packages/flutter/test/material/banner_theme_test.dart b/packages/flutter/test/material/banner_theme_test.dart index e1b2004c1a7..742cab50afa 100644 --- a/packages/flutter/test/material/banner_theme_test.dart +++ b/packages/flutter/test/material/banner_theme_test.dart @@ -67,7 +67,8 @@ void main() { final Container container = _getContainerFromBanner(tester); final RenderParagraph content = _getTextRenderObjectFromDialog(tester, contentText); 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 { diff --git a/packages/flutter/test/material/chip_theme_test.dart b/packages/flutter/test/material/chip_theme_test.dart index 6c25700f65d..e1f4fb1a14d 100644 --- a/packages/flutter/test/material/chip_theme_test.dart +++ b/packages/flutter/test/material/chip_theme_test.dart @@ -169,7 +169,7 @@ void main() { testWidgets('ChipThemeData generates correct opacities for defaults', (WidgetTester tester) async { const Color customColor1 = Color(0xcafefeed); 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( secondaryColor: customColor1, @@ -230,7 +230,7 @@ void main() { final ChipThemeData chipThemeBlack = ChipThemeData.fromDefaults( secondaryColor: Colors.black, brightness: Brightness.dark, - labelStyle: ThemeData.fallback().textTheme.body2.copyWith(color: Colors.black), + labelStyle: ThemeData.fallback().textTheme.bodyText1.copyWith(color: Colors.black), ).copyWith( elevation: 1.0, pressElevation: 4.0, @@ -241,7 +241,7 @@ void main() { final ChipThemeData chipThemeWhite = ChipThemeData.fromDefaults( secondaryColor: Colors.white, brightness: Brightness.light, - labelStyle: ThemeData.fallback().textTheme.body2.copyWith(color: Colors.white), + labelStyle: ThemeData.fallback().textTheme.bodyText1.copyWith(color: Colors.white), ).copyWith( padding: const EdgeInsets.all(2.0), labelPadding: const EdgeInsets.only(top: 8.0, bottom: 8.0), diff --git a/packages/flutter/test/material/circle_avatar_test.dart b/packages/flutter/test/material/circle_avatar_test.dart index 356b347bd20..d6e6b08a89e 100644 --- a/packages/flutter/test/material/circle_avatar_test.dart +++ b/packages/flutter/test/material/circle_avatar_test.dart @@ -117,7 +117,7 @@ void main() { expect(decoration.color, equals(theme.primaryColorLight)); 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 { @@ -142,7 +142,7 @@ void main() { expect(decoration.color, equals(theme.primaryColorDark)); 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 { diff --git a/packages/flutter/test/material/dialog_theme_test.dart b/packages/flutter/test/material/dialog_theme_test.dart index 13d410c15ba..fbbc3a91667 100644 --- a/packages/flutter/test/material/dialog_theme_test.dart +++ b/packages/flutter/test/material/dialog_theme_test.dart @@ -175,7 +175,7 @@ void main() { title: Text(titleText), actions: [ ], ); - 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.tap(find.text('X')); @@ -226,7 +226,7 @@ void main() { content: Text(contentText), actions: [ ], ); - 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.tap(find.text('X')); diff --git a/packages/flutter/test/material/expansion_tile_test.dart b/packages/flutter/test/material/expansion_tile_test.dart index 3f6954aac8c..bd4f8b0b6f3 100644 --- a/packages/flutter/test/material/expansion_tile_test.dart +++ b/packages/flutter/test/material/expansion_tile_test.dart @@ -168,7 +168,7 @@ void main() { platform: TargetPlatform.iOS, accentColor: _accentColor, unselectedWidgetColor: _unselectedWidgetColor, - textTheme: const TextTheme(subhead: TextStyle(color: _headerColor)), + textTheme: const TextTheme(subtitle1: TextStyle(color: _headerColor)), ), home: Material( child: SingleChildScrollView( diff --git a/packages/flutter/test/material/input_decorator_test.dart b/packages/flutter/test/material/input_decorator_test.dart index 2b2b75239a5..39f50c7be24 100644 --- a/packages/flutter/test/material/input_decorator_test.dart +++ b/packages/flutter/test/material/input_decorator_test.dart @@ -3613,7 +3613,7 @@ void main() { testWidgets('uses alphabetic baseline for CJK layout', (WidgetTester tester) async { await tester.binding.setLocale('zh', 'CN'); - final Typography typography = Typography(); + final Typography typography = Typography.material2018(); final FocusNode focusNode = FocusNode(); final TextEditingController controller = TextEditingController(); diff --git a/packages/flutter/test/material/popup_menu_test.dart b/packages/flutter/test/material/popup_menu_test.dart index 831d777179f..6a1609f995c 100644 --- a/packages/flutter/test/material/popup_menu_test.dart +++ b/packages/flutter/test/material/popup_menu_test.dart @@ -910,7 +910,7 @@ void main() { textDirection: textDirection, child: PopupMenuTheme( 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, ), diff --git a/packages/flutter/test/material/slider_theme_test.dart b/packages/flutter/test/material/slider_theme_test.dart index 875787317c6..7c71c25679a 100644 --- a/packages/flutter/test/material/slider_theme_test.dart +++ b/packages/flutter/test/material/slider_theme_test.dart @@ -144,7 +144,7 @@ void main() { primaryColor: customColor1, primaryColorDark: customColor2, primaryColorLight: customColor3, - valueIndicatorTextStyle: ThemeData.fallback().textTheme.body2.copyWith(color: customColor4), + valueIndicatorTextStyle: ThemeData.fallback().textTheme.bodyText1.copyWith(color: customColor4), ); expect(sliderTheme.activeTrackColor, equals(customColor1.withAlpha(0xff))); @@ -172,7 +172,7 @@ void main() { primaryColor: customColor1, primaryColorDark: customColor2, primaryColorLight: customColor3, - valueIndicatorTextStyle: ThemeData.fallback().textTheme.body2.copyWith(color: customColor4), + valueIndicatorTextStyle: ThemeData.fallback().textTheme.bodyText1.copyWith(color: customColor4), ); expect(sliderTheme.overlayShape, const RoundSliderOverlayShape()); @@ -191,13 +191,13 @@ void main() { primaryColor: Colors.black, primaryColorDark: Colors.black, primaryColorLight: Colors.black, - valueIndicatorTextStyle: ThemeData.fallback().textTheme.body2.copyWith(color: Colors.black), + valueIndicatorTextStyle: ThemeData.fallback().textTheme.bodyText1.copyWith(color: Colors.black), ).copyWith(trackHeight: 2.0); final SliderThemeData sliderThemeWhite = SliderThemeData.fromPrimaryColors( primaryColor: Colors.white, primaryColorDark: Colors.white, primaryColorLight: Colors.white, - valueIndicatorTextStyle: ThemeData.fallback().textTheme.body2.copyWith(color: Colors.white), + valueIndicatorTextStyle: ThemeData.fallback().textTheme.bodyText1.copyWith(color: Colors.white), ).copyWith(trackHeight: 6.0); final SliderThemeData lerp = SliderThemeData.lerp(sliderThemeBlack, sliderThemeWhite, 0.5); const Color middleGrey = Color(0xff7f7f7f); diff --git a/packages/flutter/test/material/snack_bar_theme_test.dart b/packages/flutter/test/material/snack_bar_theme_test.dart index 80377b5f204..0e92db6f821 100644 --- a/packages/flutter/test/material/snack_bar_theme_test.dart +++ b/packages/flutter/test/material/snack_bar_theme_test.dart @@ -91,7 +91,7 @@ void main() { final Material material = _getSnackBarMaterial(tester); final RenderParagraph content = _getSnackBarTextRenderObject(tester, text); - expect(content.text.style, Typography().white.subhead); + expect(content.text.style, Typography.material2018().white.subtitle1); expect(material.color, const Color(0xFF333333)); expect(material.elevation, 6.0); expect(material.shape, null); diff --git a/packages/flutter/test/material/text_field_test.dart b/packages/flutter/test/material/text_field_test.dart index d6177adfc14..4bc122cc93d 100644 --- a/packages/flutter/test/material/text_field_test.dart +++ b/packages/flutter/test/material/text_field_test.dart @@ -5423,7 +5423,7 @@ void main() { final ThemeData themeData = ThemeData( textTheme: TextTheme( - subhead: TextStyle( + subtitle1: TextStyle( color: Colors.blue[500], ), ), @@ -5445,12 +5445,12 @@ void main() { // Empty TextStyle is overridden by theme await tester.pumpWidget(buildFrame(const TextStyle())); EditableText editableText = tester.widget(find.byType(EditableText)); - expect(editableText.style.color, themeData.textTheme.subhead.color); - expect(editableText.style.background, themeData.textTheme.subhead.background); - expect(editableText.style.shadows, themeData.textTheme.subhead.shadows); - expect(editableText.style.decoration, themeData.textTheme.subhead.decoration); - expect(editableText.style.locale, themeData.textTheme.subhead.locale); - expect(editableText.style.wordSpacing, themeData.textTheme.subhead.wordSpacing); + expect(editableText.style.color, themeData.textTheme.subtitle1.color); + expect(editableText.style.background, themeData.textTheme.subtitle1.background); + expect(editableText.style.shadows, themeData.textTheme.subtitle1.shadows); + expect(editableText.style.decoration, themeData.textTheme.subtitle1.decoration); + expect(editableText.style.locale, themeData.textTheme.subtitle1.locale); + expect(editableText.style.wordSpacing, themeData.textTheme.subtitle1.wordSpacing); // Properties set on TextStyle override theme const Color setColor = Colors.red; diff --git a/packages/flutter/test/material/text_theme_test.dart b/packages/flutter/test/material/text_theme_test.dart index da2c20330e7..9a2e0c3b398 100644 --- a/packages/flutter/test/material/text_theme_test.dart +++ b/packages/flutter/test/material/text_theme_test.dart @@ -15,7 +15,7 @@ void main() { }); test('TextTheme copyWith apply, merge basics with Typography.black', () { - final Typography typography = Typography(platform: TargetPlatform.android); + final Typography typography = Typography.material2018(platform: TargetPlatform.android); expect(typography.black, equals(typography.black.copyWith())); expect(typography.black, equals(typography.black.apply())); expect(typography.black, equals(typography.black.merge(null))); @@ -27,20 +27,20 @@ void main() { }); test('TextTheme copyWith', () { - final Typography typography = Typography(platform: TargetPlatform.android); + final Typography typography = Typography.material2018(platform: TargetPlatform.android); final TextTheme whiteCopy = typography.black.copyWith( - display4: typography.white.display4, - display3: typography.white.display3, - display2: typography.white.display2, - display1: typography.white.display1, - headline: typography.white.headline, - title: typography.white.title, - subhead: typography.white.subhead, - body2: typography.white.body2, - body1: typography.white.body1, + headline1: typography.white.headline1, + headline2: typography.white.headline2, + headline3: typography.white.headline3, + headline4: typography.white.headline4, + headline5: typography.white.headline5, + headline6: typography.white.headline6, + subtitle1: typography.white.subtitle1, + bodyText1: typography.white.bodyText1, + bodyText2: typography.white.bodyText2, caption: typography.white.caption, button: typography.white.button, - subtitle: typography.white.subtitle, + subtitle2: typography.white.subtitle2, overline: typography.white.overline, ); expect(typography.white, equals(whiteCopy)); @@ -48,31 +48,31 @@ void main() { test('TextTheme merges properly in the presence of null fields.', () { - const TextTheme partialTheme = TextTheme(title: TextStyle(color: Color(0xcafefeed))); + const TextTheme partialTheme = TextTheme(headline6: TextStyle(color: Color(0xcafefeed))); final TextTheme fullTheme = ThemeData.fallback().textTheme.merge(partialTheme); - expect(fullTheme.title.color, equals(partialTheme.title.color)); + expect(fullTheme.headline6.color, equals(partialTheme.headline6.color)); const TextTheme onlyHeadlineAndTitle = TextTheme( - headline: TextStyle(color: Color(0xcafefeed)), - title: TextStyle(color: Color(0xbeefcafe)), + headline5: TextStyle(color: Color(0xcafefeed)), + headline6: TextStyle(color: Color(0xbeefcafe)), ); const TextTheme onlyBody1AndTitle = TextTheme( - body1: TextStyle(color: Color(0xfeedfeed)), - title: TextStyle(color: Color(0xdeadcafe)), + bodyText2: TextStyle(color: Color(0xfeedfeed)), + headline6: TextStyle(color: Color(0xdeadcafe)), ); TextTheme merged = onlyHeadlineAndTitle.merge(onlyBody1AndTitle); - expect(merged.body2, isNull); - expect(merged.body1.color, equals(onlyBody1AndTitle.body1.color)); - expect(merged.headline.color, equals(onlyHeadlineAndTitle.headline.color)); - expect(merged.title.color, equals(onlyBody1AndTitle.title.color)); + expect(merged.bodyText1, isNull); + expect(merged.bodyText2.color, equals(onlyBody1AndTitle.bodyText2.color)); + expect(merged.headline5.color, equals(onlyHeadlineAndTitle.headline5.color)); + expect(merged.headline6.color, equals(onlyBody1AndTitle.headline6.color)); merged = onlyHeadlineAndTitle.merge(null); expect(merged, equals(onlyHeadlineAndTitle)); }); test('TextTheme apply', () { - // The `displayColor` is applied to [display4], [display3], [display2], - // [display1], and [caption]. The `bodyColor` is applied to the remaining + // The `displayColor` is applied to [headline1], [headline2], [headline3], + // [headline4], and [caption]. The `bodyColor` is applied to the remaining // text styles. const Color displayColor = Color(0x00000001); const Color bodyColor = Color(0x00000002); @@ -84,7 +84,7 @@ void main() { TextDecoration.lineThrough, ]); - final Typography typography = Typography(platform: TargetPlatform.android); + final Typography typography = Typography.material2018(platform: TargetPlatform.android); final TextTheme theme = typography.black.apply( fontFamily: fontFamily, displayColor: displayColor, @@ -94,33 +94,33 @@ void main() { decorationStyle: decorationStyle, ); - expect(theme.display4.color, displayColor); - expect(theme.display3.color, displayColor); - expect(theme.display2.color, displayColor); - expect(theme.display1.color, displayColor); + expect(theme.headline1.color, displayColor); + expect(theme.headline2.color, displayColor); + expect(theme.headline3.color, displayColor); + expect(theme.headline4.color, displayColor); expect(theme.caption.color, displayColor); - expect(theme.headline.color, bodyColor); - expect(theme.title.color, bodyColor); - expect(theme.subhead.color, bodyColor); - expect(theme.body2.color, bodyColor); - expect(theme.body1.color, bodyColor); + expect(theme.headline5.color, bodyColor); + expect(theme.headline6.color, bodyColor); + expect(theme.subtitle1.color, bodyColor); + expect(theme.bodyText1.color, bodyColor); + expect(theme.bodyText2.color, bodyColor); expect(theme.button.color, bodyColor); - expect(theme.subtitle.color, bodyColor); + expect(theme.subtitle2.color, bodyColor); expect(theme.overline.color, bodyColor); final List themeStyles = [ - theme.display4, - theme.display3, - theme.display2, - theme.display1, + theme.headline1, + theme.headline2, + theme.headline3, + theme.headline4, theme.caption, - theme.headline, - theme.title, - theme.subhead, - theme.body2, - theme.body1, + theme.headline5, + theme.headline6, + theme.subtitle1, + theme.bodyText1, + theme.bodyText2, theme.button, - theme.subtitle, + theme.subtitle2, theme.overline, ]; expect(themeStyles.every((TextStyle style) => style.fontFamily == fontFamily), true); @@ -130,80 +130,80 @@ void main() { }); test('TextTheme apply fontSizeFactor fontSizeDelta', () { - final Typography typography = Typography(platform: TargetPlatform.android); - final TextTheme baseTheme = Typography.englishLike2014.merge(typography.black); + final Typography typography = Typography.material2018(platform: TargetPlatform.android); + final TextTheme baseTheme = Typography.englishLike2018.merge(typography.black); final TextTheme sizeTheme = baseTheme.apply( fontSizeFactor: 2.0, fontSizeDelta: 5.0, ); - expect(sizeTheme.display4.fontSize, baseTheme.display4.fontSize * 2.0 + 5.0); - expect(sizeTheme.display3.fontSize, baseTheme.display3.fontSize * 2.0 + 5.0); - expect(sizeTheme.display2.fontSize, baseTheme.display2.fontSize * 2.0 + 5.0); - expect(sizeTheme.display1.fontSize, baseTheme.display1.fontSize * 2.0 + 5.0); + expect(sizeTheme.headline1.fontSize, baseTheme.headline1.fontSize * 2.0 + 5.0); + expect(sizeTheme.headline2.fontSize, baseTheme.headline2.fontSize * 2.0 + 5.0); + expect(sizeTheme.headline3.fontSize, baseTheme.headline3.fontSize * 2.0 + 5.0); + expect(sizeTheme.headline4.fontSize, baseTheme.headline4.fontSize * 2.0 + 5.0); expect(sizeTheme.caption.fontSize, baseTheme.caption.fontSize * 2.0 + 5.0); - expect(sizeTheme.headline.fontSize, baseTheme.headline.fontSize * 2.0 + 5.0); - expect(sizeTheme.title.fontSize, baseTheme.title.fontSize * 2.0 + 5.0); - expect(sizeTheme.subhead.fontSize, baseTheme.subhead.fontSize * 2.0 + 5.0); - expect(sizeTheme.body2.fontSize, baseTheme.body2.fontSize * 2.0 + 5.0); - expect(sizeTheme.body1.fontSize, baseTheme.body1.fontSize * 2.0 + 5.0); + expect(sizeTheme.headline5.fontSize, baseTheme.headline5.fontSize * 2.0 + 5.0); + expect(sizeTheme.headline6.fontSize, baseTheme.headline6.fontSize * 2.0 + 5.0); + expect(sizeTheme.subtitle1.fontSize, baseTheme.subtitle1.fontSize * 2.0 + 5.0); + expect(sizeTheme.bodyText1.fontSize, baseTheme.bodyText1.fontSize * 2.0 + 5.0); + expect(sizeTheme.bodyText2.fontSize, baseTheme.bodyText2.fontSize * 2.0 + 5.0); expect(sizeTheme.button.fontSize, baseTheme.button.fontSize * 2.0 + 5.0); - expect(sizeTheme.subtitle.fontSize, baseTheme.subtitle.fontSize * 2.0 + 5.0); + expect(sizeTheme.subtitle2.fontSize, baseTheme.subtitle2.fontSize * 2.0 + 5.0); expect(sizeTheme.overline.fontSize, baseTheme.overline.fontSize * 2.0 + 5.0); }); test('TextTheme lerp with second parameter null', () { - final TextTheme theme = Typography().black; + final TextTheme theme = Typography.material2018().black; final TextTheme lerped = TextTheme.lerp(theme, null, 0.25); - expect(lerped.display4, TextStyle.lerp(theme.display4, null, 0.25)); - expect(lerped.display3, TextStyle.lerp(theme.display3, null, 0.25)); - expect(lerped.display2, TextStyle.lerp(theme.display2, null, 0.25)); - expect(lerped.display1, TextStyle.lerp(theme.display1, null, 0.25)); + expect(lerped.headline1, TextStyle.lerp(theme.headline1, null, 0.25)); + expect(lerped.headline2, TextStyle.lerp(theme.headline2, null, 0.25)); + expect(lerped.headline3, TextStyle.lerp(theme.headline3, null, 0.25)); + expect(lerped.headline4, TextStyle.lerp(theme.headline4, null, 0.25)); expect(lerped.caption, TextStyle.lerp(theme.caption, null, 0.25)); - expect(lerped.headline, TextStyle.lerp(theme.headline, null, 0.25)); - expect(lerped.title, TextStyle.lerp(theme.title, null, 0.25)); - expect(lerped.subhead, TextStyle.lerp(theme.subhead, null, 0.25)); - expect(lerped.body2, TextStyle.lerp(theme.body2, null, 0.25)); - expect(lerped.body1, TextStyle.lerp(theme.body1, null, 0.25)); + expect(lerped.headline5, TextStyle.lerp(theme.headline5, null, 0.25)); + expect(lerped.headline6, TextStyle.lerp(theme.headline6, null, 0.25)); + expect(lerped.subtitle1, TextStyle.lerp(theme.subtitle1, null, 0.25)); + expect(lerped.bodyText1, TextStyle.lerp(theme.bodyText1, null, 0.25)); + expect(lerped.bodyText2, TextStyle.lerp(theme.bodyText2, null, 0.25)); expect(lerped.button, TextStyle.lerp(theme.button, null, 0.25)); - expect(lerped.subtitle, TextStyle.lerp(theme.subtitle, null, 0.25)); + expect(lerped.subtitle2, TextStyle.lerp(theme.subtitle2, null, 0.25)); expect(lerped.overline, TextStyle.lerp(theme.overline, null, 0.25)); }); test('TextTheme lerp with first parameter null', () { - final TextTheme theme = Typography().black; + final TextTheme theme = Typography.material2018().black; final TextTheme lerped = TextTheme.lerp(null, theme, 0.25); - expect(lerped.display4, TextStyle.lerp(null, theme.display4, 0.25)); - expect(lerped.display3, TextStyle.lerp(null, theme.display3, 0.25)); - expect(lerped.display2, TextStyle.lerp(null, theme.display2, 0.25)); - expect(lerped.display1, TextStyle.lerp(null, theme.display1, 0.25)); + expect(lerped.headline1, TextStyle.lerp(null, theme.headline1, 0.25)); + expect(lerped.headline2, TextStyle.lerp(null, theme.headline2, 0.25)); + expect(lerped.headline3, TextStyle.lerp(null, theme.headline3, 0.25)); + expect(lerped.headline4, TextStyle.lerp(null, theme.headline4, 0.25)); expect(lerped.caption, TextStyle.lerp(null, theme.caption, 0.25)); - expect(lerped.headline, TextStyle.lerp(null, theme.headline, 0.25)); - expect(lerped.title, TextStyle.lerp(null, theme.title, 0.25)); - expect(lerped.subhead, TextStyle.lerp(null, theme.subhead, 0.25)); - expect(lerped.body2, TextStyle.lerp(null, theme.body2, 0.25)); - expect(lerped.body1, TextStyle.lerp(null, theme.body1, 0.25)); + expect(lerped.headline5, TextStyle.lerp(null, theme.headline5, 0.25)); + expect(lerped.headline6, TextStyle.lerp(null, theme.headline6, 0.25)); + expect(lerped.subtitle1, TextStyle.lerp(null, theme.subtitle1, 0.25)); + expect(lerped.bodyText1, TextStyle.lerp(null, theme.bodyText1, 0.25)); + expect(lerped.bodyText2, TextStyle.lerp(null, theme.bodyText2, 0.25)); expect(lerped.button, TextStyle.lerp(null, theme.button, 0.25)); - expect(lerped.subtitle, TextStyle.lerp(null, theme.subtitle, 0.25)); + expect(lerped.subtitle2, TextStyle.lerp(null, theme.subtitle2, 0.25)); expect(lerped.overline, TextStyle.lerp(null, theme.overline, 0.25)); }); test('TextTheme lerp with null parameters', () { final TextTheme lerped = TextTheme.lerp(null, null, 0.25); - expect(lerped.display4, null); - expect(lerped.display3, null); - expect(lerped.display2, null); - expect(lerped.display1, null); + expect(lerped.headline1, null); + expect(lerped.headline2, null); + expect(lerped.headline3, null); + expect(lerped.headline4, null); expect(lerped.caption, null); - expect(lerped.headline, null); - expect(lerped.title, null); - expect(lerped.subhead, null); - expect(lerped.body2, null); - expect(lerped.body1, null); + expect(lerped.headline5, null); + expect(lerped.headline6, null); + expect(lerped.subtitle1, null); + expect(lerped.bodyText1, null); + expect(lerped.bodyText2, null); expect(lerped.button, null); - expect(lerped.subtitle, null); + expect(lerped.subtitle2, null); expect(lerped.overline, null); }); } diff --git a/packages/flutter/test/material/theme_data_test.dart b/packages/flutter/test/material/theme_data_test.dart index 041ed51daf5..0f075ff68b1 100644 --- a/packages/flutter/test/material/theme_data_test.dart +++ b/packages/flutter/test/material/theme_data_test.dart @@ -23,7 +23,7 @@ void main() { test('Defaults to the default typography for the platform', () { for (final TargetPlatform platform in TargetPlatform.values) { final ThemeData theme = ThemeData(platform: platform); - final Typography typography = Typography(platform: platform); + final Typography typography = Typography.material2018(platform: platform); expect(theme.textTheme, typography.black.apply(decoration: TextDecoration.none), reason: 'Not using default typography for $platform'); } @@ -32,65 +32,65 @@ void main() { test('Default text theme contrasts with brightness', () { final ThemeData lightTheme = ThemeData(brightness: Brightness.light); final ThemeData darkTheme = ThemeData(brightness: Brightness.dark); - final Typography typography = Typography(platform: lightTheme.platform); + final Typography typography = Typography.material2018(platform: lightTheme.platform); - expect(lightTheme.textTheme.title.color, typography.black.title.color); - expect(darkTheme.textTheme.title.color, typography.white.title.color); + expect(lightTheme.textTheme.headline6.color, typography.black.headline6.color); + expect(darkTheme.textTheme.headline6.color, typography.white.headline6.color); }); test('Default primary text theme contrasts with primary brightness', () { final ThemeData lightTheme = ThemeData(primaryColorBrightness: Brightness.light); final ThemeData darkTheme = ThemeData(primaryColorBrightness: Brightness.dark); - final Typography typography = Typography(platform: lightTheme.platform); + final Typography typography = Typography.material2018(platform: lightTheme.platform); - expect(lightTheme.primaryTextTheme.title.color, typography.black.title.color); - expect(darkTheme.primaryTextTheme.title.color, typography.white.title.color); + expect(lightTheme.primaryTextTheme.headline6.color, typography.black.headline6.color); + expect(darkTheme.primaryTextTheme.headline6.color, typography.white.headline6.color); }); test('Default accent text theme contrasts with accent brightness', () { final ThemeData lightTheme = ThemeData(accentColorBrightness: Brightness.light); final ThemeData darkTheme = ThemeData(accentColorBrightness: Brightness.dark); - final Typography typography = Typography(platform: lightTheme.platform); + final Typography typography = Typography.material2018(platform: lightTheme.platform); - expect(lightTheme.accentTextTheme.title.color, typography.black.title.color); - expect(darkTheme.accentTextTheme.title.color, typography.white.title.color); + expect(lightTheme.accentTextTheme.headline6.color, typography.black.headline6.color); + expect(darkTheme.accentTextTheme.headline6.color, typography.white.headline6.color); }); - test('Default chip label style gets a default body2 if textTheme.body2 is null', () { - const TextTheme noBody2TextTheme = TextTheme(body2: null); - final ThemeData lightTheme = ThemeData(brightness: Brightness.light, textTheme: noBody2TextTheme); - final ThemeData darkTheme = ThemeData(brightness: Brightness.dark, textTheme: noBody2TextTheme); - final Typography typography = Typography(platform: lightTheme.platform); + test('Default chip label style gets a default bodyText1 if textTheme.bodyText1 is null', () { + const TextTheme noBodyText1TextTheme = TextTheme(bodyText1: null); + final ThemeData lightTheme = ThemeData(brightness: Brightness.light, textTheme: noBodyText1TextTheme); + final ThemeData darkTheme = ThemeData(brightness: Brightness.dark, textTheme: noBodyText1TextTheme); + final Typography typography = Typography.material2018(platform: lightTheme.platform); - expect(lightTheme.chipTheme.labelStyle.color, equals(typography.black.body2.color.withAlpha(0xde))); - expect(darkTheme.chipTheme.labelStyle.color, equals(typography.white.body2.color.withAlpha(0xde))); + expect(lightTheme.chipTheme.labelStyle.color, equals(typography.black.bodyText1.color.withAlpha(0xde))); + expect(darkTheme.chipTheme.labelStyle.color, equals(typography.white.bodyText1.color.withAlpha(0xde))); }); test('Default icon theme contrasts with brightness', () { final ThemeData lightTheme = ThemeData(brightness: Brightness.light); final ThemeData darkTheme = ThemeData(brightness: Brightness.dark); - final Typography typography = Typography(platform: lightTheme.platform); + final Typography typography = Typography.material2018(platform: lightTheme.platform); - expect(lightTheme.textTheme.title.color, typography.black.title.color); - expect(darkTheme.textTheme.title.color, typography.white.title.color); + expect(lightTheme.textTheme.headline6.color, typography.black.headline6.color); + expect(darkTheme.textTheme.headline6.color, typography.white.headline6.color); }); test('Default primary icon theme contrasts with primary brightness', () { final ThemeData lightTheme = ThemeData(primaryColorBrightness: Brightness.light); final ThemeData darkTheme = ThemeData(primaryColorBrightness: Brightness.dark); - final Typography typography = Typography(platform: lightTheme.platform); + final Typography typography = Typography.material2018(platform: lightTheme.platform); - expect(lightTheme.primaryTextTheme.title.color, typography.black.title.color); - expect(darkTheme.primaryTextTheme.title.color, typography.white.title.color); + expect(lightTheme.primaryTextTheme.headline6.color, typography.black.headline6.color); + expect(darkTheme.primaryTextTheme.headline6.color, typography.white.headline6.color); }); test('Default accent icon theme contrasts with accent brightness', () { final ThemeData lightTheme = ThemeData(accentColorBrightness: Brightness.light); final ThemeData darkTheme = ThemeData(accentColorBrightness: Brightness.dark); - final Typography typography = Typography(platform: lightTheme.platform); + final Typography typography = Typography.material2018(platform: lightTheme.platform); - expect(lightTheme.accentTextTheme.title.color, typography.black.title.color); - expect(darkTheme.accentTextTheme.title.color, typography.white.title.color); + expect(lightTheme.accentTextTheme.headline6.color, typography.black.headline6.color); + expect(darkTheme.accentTextTheme.headline6.color, typography.white.headline6.color); }); test('Defaults to MaterialTapTargetBehavior.expanded', () { @@ -103,16 +103,16 @@ void main() { final ThemeData themeData = ThemeData( fontFamily: 'Ahem', textTheme: const TextTheme( - title: TextStyle(fontFamily: 'Roboto'), + headline6: TextStyle(fontFamily: 'Roboto'), ), ); - expect(themeData.textTheme.body2.fontFamily, equals('Ahem')); - expect(themeData.primaryTextTheme.display2.fontFamily, equals('Ahem')); - expect(themeData.accentTextTheme.display4.fontFamily, equals('Ahem')); + expect(themeData.textTheme.bodyText1.fontFamily, equals('Ahem')); + expect(themeData.primaryTextTheme.headline3.fontFamily, equals('Ahem')); + expect(themeData.accentTextTheme.headline1.fontFamily, equals('Ahem')); // Shouldn't override the specified style's family - expect(themeData.textTheme.title.fontFamily, equals('Roboto')); + expect(themeData.textTheme.headline6.fontFamily, equals('Roboto')); }); test('Can estimate brightness - directly', () { @@ -255,7 +255,7 @@ void main() { colorScheme: const ColorScheme.light(), dialogTheme: const DialogTheme(backgroundColor: Colors.black), floatingActionButtonTheme: const FloatingActionButtonThemeData(backgroundColor: Colors.black), - typography: Typography(platform: TargetPlatform.android), + typography: Typography.material2018(platform: TargetPlatform.android), cupertinoOverrideTheme: null, snackBarTheme: const SnackBarThemeData(backgroundColor: Colors.black), bottomSheetTheme: const BottomSheetThemeData(backgroundColor: Colors.black), @@ -334,7 +334,7 @@ void main() { colorScheme: const ColorScheme.light(), dialogTheme: const DialogTheme(backgroundColor: Colors.white), floatingActionButtonTheme: const FloatingActionButtonThemeData(backgroundColor: Colors.white), - typography: Typography(platform: TargetPlatform.iOS), + typography: Typography.material2018(platform: TargetPlatform.iOS), cupertinoOverrideTheme: ThemeData.light().cupertinoOverrideTheme, snackBarTheme: const SnackBarThemeData(backgroundColor: Colors.white), bottomSheetTheme: const BottomSheetThemeData(backgroundColor: Colors.white), diff --git a/packages/flutter/test/material/theme_test.dart b/packages/flutter/test/material/theme_test.dart index c0f342b71d6..b4e2302bcf3 100644 --- a/packages/flutter/test/material/theme_test.dart +++ b/packages/flutter/test/material/theme_test.dart @@ -336,12 +336,12 @@ void main() { final ThemeData fallback = ThemeData.fallback(); final ThemeData customTheme = fallback.copyWith( primaryTextTheme: fallback.primaryTextTheme.copyWith( - body1: fallback.primaryTextTheme.body1.copyWith( + bodyText2: fallback.primaryTextTheme.bodyText2.copyWith( fontSize: _kMagicFontSize, ), ), ); - expect(customTheme.primaryTextTheme.body1.fontSize, _kMagicFontSize); + expect(customTheme.primaryTextTheme.bodyText2.fontSize, _kMagicFontSize); double actualFontSize; await tester.pumpWidget(Directionality( @@ -350,10 +350,10 @@ void main() { data: customTheme, child: Builder(builder: (BuildContext context) { final ThemeData theme = Theme.of(context); - actualFontSize = theme.primaryTextTheme.body1.fontSize; + actualFontSize = theme.primaryTextTheme.bodyText2.fontSize; return Text( 'A', - style: theme.primaryTextTheme.body1, + style: theme.primaryTextTheme.bodyText2, ); }), ), @@ -376,15 +376,15 @@ void main() { List extractStyles(TextTheme textTheme) { return [ - textTheme.display4, - textTheme.display3, - textTheme.display2, - textTheme.display1, - textTheme.headline, - textTheme.title, - textTheme.subhead, - textTheme.body2, - textTheme.body1, + textTheme.headline1, + textTheme.headline2, + textTheme.headline3, + textTheme.headline4, + textTheme.headline5, + textTheme.headline6, + textTheme.subtitle1, + textTheme.bodyText1, + textTheme.bodyText2, textTheme.caption, textTheme.button, ]; @@ -411,7 +411,7 @@ void main() { } } - expect(theme.textTheme.display4.debugLabel, '(englishLike display4 2014).merge(blackMountainView display4)'); + expect(theme.textTheme.headline1.debugLabel, '(englishLike display4 2014).merge(blackMountainView headline1)'); }); group('Cupertino theme', () { diff --git a/packages/flutter/test/material/toggle_buttons_test.dart b/packages/flutter/test/material/toggle_buttons_test.dart index 6bef7abd9eb..791df6d0695 100644 --- a/packages/flutter/test/material/toggle_buttons_test.dart +++ b/packages/flutter/test/material/toggle_buttons_test.dart @@ -259,15 +259,15 @@ void main() { of: find.widgetWithText(RawMaterialButton, 'First child'), matching: find.byType(DefaultTextStyle), )).style; - expect(textStyle.fontFamily, theme.textTheme.body1.fontFamily); - expect(textStyle.decoration, theme.textTheme.body1.decoration); + expect(textStyle.fontFamily, theme.textTheme.bodyText2.fontFamily); + expect(textStyle.decoration, theme.textTheme.bodyText2.decoration); textStyle = tester.widget(find.descendant( of: find.widgetWithText(RawMaterialButton, 'Second child'), matching: find.byType(DefaultTextStyle), )).style; - expect(textStyle.fontFamily, theme.textTheme.body1.fontFamily); - expect(textStyle.decoration, theme.textTheme.body1.decoration); + expect(textStyle.fontFamily, theme.textTheme.bodyText2.fontFamily); + expect(textStyle.decoration, theme.textTheme.bodyText2.decoration); }); testWidgets('Custom text style except color is applied', (WidgetTester tester) async { diff --git a/packages/flutter/test/material/tooltip_test.dart b/packages/flutter/test/material/tooltip_test.dart index bcdd9976659..5e28e5ed1bb 100644 --- a/packages/flutter/test/material/tooltip_test.dart +++ b/packages/flutter/test/material/tooltip_test.dart @@ -521,7 +521,7 @@ void main() { expect(textStyle.color, Colors.white); expect(textStyle.fontFamily, 'Roboto'); expect(textStyle.decoration, TextDecoration.none); - expect(textStyle.debugLabel, '((englishLike body1 2014).merge(blackMountainView body1)).copyWith'); + expect(textStyle.debugLabel, '((englishLike body1 2014).merge(blackMountainView bodyText2)).copyWith'); }); testWidgets('Default tooltip message textStyle - dark', (WidgetTester tester) async { @@ -547,7 +547,7 @@ void main() { expect(textStyle.color, Colors.black); expect(textStyle.fontFamily, 'Roboto'); expect(textStyle.decoration, TextDecoration.none); - expect(textStyle.debugLabel, '((englishLike body1 2014).merge(whiteMountainView body1)).copyWith'); + expect(textStyle.debugLabel, '((englishLike body1 2014).merge(whiteMountainView bodyText2)).copyWith'); }); testWidgets('Custom tooltip message textStyle', (WidgetTester tester) async { diff --git a/packages/flutter/test/material/typography_test.dart b/packages/flutter/test/material/typography_test.dart index 726f2c4de99..f83dcf4f7e7 100644 --- a/packages/flutter/test/material/typography_test.dart +++ b/packages/flutter/test/material/typography_test.dart @@ -9,7 +9,7 @@ import 'package:flutter_test/flutter_test.dart'; void main() { test('Typography is defined for all target platforms', () { for (final TargetPlatform platform in TargetPlatform.values) { - final Typography typography = Typography(platform: platform); + final Typography typography = Typography.material2018(platform: platform); expect(typography, isNotNull, reason: 'null typography for $platform'); expect(typography.black, isNotNull, reason: 'null black typography for $platform'); expect(typography.white, isNotNull, reason: 'null white typography for $platform'); @@ -17,8 +17,8 @@ void main() { }); test('Typography on Android, Fuchsia defaults to Roboto', () { - expect(Typography(platform: TargetPlatform.android).black.title.fontFamily, 'Roboto'); - expect(Typography(platform: TargetPlatform.fuchsia).black.title.fontFamily, 'Roboto'); + expect(Typography.material2018(platform: TargetPlatform.android).black.headline6.fontFamily, 'Roboto'); + expect(Typography.material2018(platform: TargetPlatform.fuchsia).black.headline6.fontFamily, 'Roboto'); }); test('Typography on iOS defaults to the correct SF font family based on size', () { @@ -31,27 +31,27 @@ void main() { return s.fontFamily == '.SF UI Text'; }, 'Uses SF Text font'); - final Typography typography = Typography(platform: TargetPlatform.iOS); + final Typography typography = Typography.material2018(platform: TargetPlatform.iOS); for (final TextTheme textTheme in [typography.black, typography.white]) { - expect(textTheme.display4, isDisplayFont); - expect(textTheme.display3, isDisplayFont); - expect(textTheme.display2, isDisplayFont); - expect(textTheme.display1, isDisplayFont); - expect(textTheme.headline, isDisplayFont); - expect(textTheme.title, isDisplayFont); - expect(textTheme.subhead, isTextFont); - expect(textTheme.body2, isTextFont); - expect(textTheme.body1, isTextFont); + expect(textTheme.headline1, isDisplayFont); + expect(textTheme.headline2, isDisplayFont); + expect(textTheme.headline3, isDisplayFont); + expect(textTheme.headline4, isDisplayFont); + expect(textTheme.headline5, isDisplayFont); + expect(textTheme.headline6, isDisplayFont); + expect(textTheme.subtitle1, isTextFont); + expect(textTheme.bodyText1, isTextFont); + expect(textTheme.bodyText2, isTextFont); expect(textTheme.caption, isTextFont); expect(textTheme.button, isTextFont); - expect(textTheme.subtitle, isTextFont); + expect(textTheme.subtitle2, isTextFont); expect(textTheme.overline, isTextFont); } }); testWidgets('Typography implements debugFillProperties', (WidgetTester tester) async { final DiagnosticPropertiesBuilder builder = DiagnosticPropertiesBuilder(); - Typography( + Typography.material2014( platform: TargetPlatform.android, black: Typography.blackCupertino, white: Typography.whiteCupertino, @@ -66,4 +66,95 @@ void main() { expect(nonDefaultPropertyNames, ['black', 'white', 'englishLike', 'dense', 'tall']); }); + + test('englishLike2018 TextTheme matches Material Design spec', () { + // Check the default material text theme against the style values + // shown https://material.io/design/typography/#type-scale. + + final TextTheme theme = Typography.englishLike2018.merge(Typography.blackMountainView); + const FontWeight light = FontWeight.w300; + const FontWeight regular = FontWeight.w400; + const FontWeight medium = FontWeight.w500; + + // H1 Roboto light 96 -1.5 + expect(theme.headline1.fontFamily, 'Roboto'); + expect(theme.headline1.fontWeight, light); + expect(theme.headline1.fontSize, 96); + expect(theme.headline1.letterSpacing, -1.5); + + // H2 Roboto light 60 -0.5 + expect(theme.headline2.fontFamily, 'Roboto'); + expect(theme.headline2.fontWeight, light); + expect(theme.headline2.fontSize, 60); + expect(theme.headline2.letterSpacing, -0.5); + + // H3 Roboto regular 48 0 + expect(theme.headline3.fontFamily, 'Roboto'); + expect(theme.headline3.fontWeight, regular); + expect(theme.headline3.fontSize, 48); + expect(theme.headline3.letterSpacing, 0); + + // H4 Roboto regular 34 0.25 + expect(theme.headline4.fontFamily, 'Roboto'); + expect(theme.headline4.fontWeight, regular); + expect(theme.headline4.fontSize, 34); + expect(theme.headline4.letterSpacing, 0.25); + + // H5 Roboto regular 24 0 + expect(theme.headline5.fontFamily, 'Roboto'); + expect(theme.headline5.fontWeight, regular); + expect(theme.headline5.fontSize, 24); + expect(theme.headline5.letterSpacing, 0); + + // H6 Roboto medium 20 0.15 + expect(theme.headline6.fontFamily, 'Roboto'); + expect(theme.headline6.fontWeight, medium); + expect(theme.headline6.fontSize, 20); + expect(theme.headline6.letterSpacing, 0.15); + + // Subtitle1 Roboto regular 16 0.15 + expect(theme.subtitle1.fontFamily, 'Roboto'); + expect(theme.subtitle1.fontWeight, regular); + expect(theme.subtitle1.fontSize, 16); + expect(theme.subtitle1.letterSpacing, 0.15); + + // Subtitle2 Roboto medium 14 0.1 + expect(theme.subtitle2.fontFamily, 'Roboto'); + expect(theme.subtitle2.fontWeight, medium); + expect(theme.subtitle2.fontSize, 14); + expect(theme.subtitle2.letterSpacing, 0.1); + + // Body1 Roboto regular 16 0.5 + expect(theme.bodyText1.fontFamily, 'Roboto'); + expect(theme.bodyText1.fontWeight, regular); + // TODO(hansmuller): restore after englishLike2018 has been updated per #38904. + //expect(theme.bodyText1.fontSize, 16); + //expect(theme.bodyText1.letterSpacing, 0.5); + + // Body2 Roboto regular 14 0.25 + expect(theme.bodyText2.fontFamily, 'Roboto'); + expect(theme.bodyText2.fontWeight, regular); + // TODO(hansmuller): restore after englishLike2018 has been updated per #38904. + //expect(theme.bodyText2.fontSize, 14); + //expect(theme.bodyText2.letterSpacing, 0.25); + + // BUTTON Roboto medium 14 1.25 + expect(theme.button.fontFamily, 'Roboto'); + expect(theme.button.fontWeight, medium); + expect(theme.button.fontSize, 14); + // TODO(hansmuller): restore after englishLike2018 has been updated, per #38904. + //expect(theme.button.letterSpacing, 1.25); + + // Caption Roboto regular 12 0.4 + expect(theme.caption.fontFamily, 'Roboto'); + expect(theme.caption.fontWeight, regular); + expect(theme.caption.fontSize, 12); + expect(theme.caption.letterSpacing, 0.4); + + // OVERLINE Roboto regular 10 1.5 + expect(theme.overline.fontFamily, 'Roboto'); + expect(theme.overline.fontWeight, regular); + expect(theme.overline.fontSize, 10); + expect(theme.overline.letterSpacing, 1.5); + }); } diff --git a/packages/flutter/test/rendering/localized_fonts_test.dart b/packages/flutter/test/rendering/localized_fonts_test.dart index 9c37ef48313..0c3995ae8f2 100644 --- a/packages/flutter/test/rendering/localized_fonts_test.dart +++ b/packages/flutter/test/rendering/localized_fonts_test.dart @@ -23,7 +23,7 @@ void main() { home: Builder( builder: (BuildContext context) { const String character = '骨'; - final TextStyle style = Theme.of(context).textTheme.display3; + final TextStyle style = Theme.of(context).textTheme.headline2; return Scaffold( body: Container( padding: const EdgeInsets.all(48.0), @@ -68,7 +68,7 @@ void main() { home: Builder( builder: (BuildContext context) { const String character = '骨'; - final TextStyle style = Theme.of(context).textTheme.display3; + final TextStyle style = Theme.of(context).textTheme.headline2; return Scaffold( body: Container( padding: const EdgeInsets.all(48.0), @@ -120,7 +120,7 @@ void main() { home: Builder( builder: (BuildContext context) { const String character = '骨'; - final TextStyle style = Theme.of(context).textTheme.display3; + final TextStyle style = Theme.of(context).textTheme.headline2; return Scaffold( body: Container( padding: const EdgeInsets.all(48.0), diff --git a/packages/flutter/test/widgets/editable_text_cursor_test.dart b/packages/flutter/test/widgets/editable_text_cursor_test.dart index e0d4861de48..c34391792c5 100644 --- a/packages/flutter/test/widgets/editable_text_cursor_test.dart +++ b/packages/flutter/test/widgets/editable_text_cursor_test.dart @@ -52,7 +52,7 @@ void main() { key: editableTextKey, controller: TextEditingController(), focusNode: FocusNode(), - style: Typography(platform: TargetPlatform.android).black.subhead, + style: Typography.material2018(platform: TargetPlatform.android).black.subtitle1, cursorColor: Colors.blue, selectionControls: materialTextSelectionControls, keyboardType: TextInputType.text, @@ -106,7 +106,7 @@ void main() { key: editableTextKey, controller: TextEditingController(), focusNode: FocusNode(), - style: Typography(platform: TargetPlatform.android).black.subhead, + style: Typography.material2018(platform: TargetPlatform.android).black.subtitle1, cursorColor: Colors.blue, selectionControls: materialTextSelectionControls, keyboardType: TextInputType.text, @@ -751,7 +751,7 @@ void main() { key: editableTextKey, controller: TextEditingController(), focusNode: FocusNode(), - style: Typography(platform: TargetPlatform.iOS).black.subhead, + style: Typography.material2018(platform: TargetPlatform.iOS).black.subtitle1, cursorColor: Colors.blue, selectionControls: materialTextSelectionControls, keyboardType: TextInputType.text, diff --git a/packages/flutter/test/widgets/editable_text_test.dart b/packages/flutter/test/widgets/editable_text_test.dart index 34af7e7d6dd..53c6fe3bc52 100644 --- a/packages/flutter/test/widgets/editable_text_test.dart +++ b/packages/flutter/test/widgets/editable_text_test.dart @@ -1170,7 +1170,7 @@ void main() { backgroundCursorColor: Colors.grey, controller: TextEditingController(), focusNode: FocusNode(), - style: Typography(platform: TargetPlatform.android).black.subhead, + style: Typography.material2018(platform: TargetPlatform.android).black.subtitle1, cursorColor: Colors.blue, selectionControls: materialTextSelectionControls, keyboardType: TextInputType.text, @@ -1205,7 +1205,7 @@ void main() { backgroundCursorColor: Colors.grey, controller: TextEditingController(), focusNode: focusNode, - style: Typography(platform: TargetPlatform.android).black.subhead, + style: Typography.material2018(platform: TargetPlatform.android).black.subtitle1, cursorColor: Colors.blue, selectionControls: materialTextSelectionControls, keyboardType: TextInputType.text, @@ -1235,7 +1235,7 @@ void main() { backgroundCursorColor: Colors.grey, controller: TextEditingController(), focusNode: focusNode, - style: Typography(platform: TargetPlatform.android).black.subhead, + style: Typography.material2018(platform: TargetPlatform.android).black.subtitle1, cursorColor: Colors.blue, selectionControls: materialTextSelectionControls, keyboardType: TextInputType.text, @@ -1272,7 +1272,7 @@ void main() { backgroundCursorColor: Colors.grey, controller: TextEditingController(), focusNode: focusNode, - style: Typography(platform: TargetPlatform.android).black.subhead, + style: Typography.material2018(platform: TargetPlatform.android).black.subtitle1, cursorColor: Colors.blue, onEditingComplete: () { onEditingCompleteCalled = true; @@ -1312,7 +1312,7 @@ void main() { backgroundCursorColor: Colors.grey, controller: TextEditingController(), focusNode: focusNode, - style: Typography(platform: TargetPlatform.android).black.subhead, + style: Typography.material2018(platform: TargetPlatform.android).black.subtitle1, cursorColor: Colors.blue, onEditingComplete: () { onEditingCompleteCalled = true; @@ -1352,7 +1352,7 @@ void main() { backgroundCursorColor: Colors.grey, controller: TextEditingController(), focusNode: focusNode, - style: Typography(platform: TargetPlatform.android).black.subhead, + style: Typography.material2018(platform: TargetPlatform.android).black.subtitle1, cursorColor: Colors.blue, maxLines: 1, onEditingComplete: () { @@ -1392,7 +1392,7 @@ void main() { backgroundCursorColor: Colors.grey, controller: TextEditingController(), focusNode: focusNode, - style: Typography(platform: TargetPlatform.android).black.subhead, + style: Typography.material2018(platform: TargetPlatform.android).black.subtitle1, cursorColor: Colors.blue, maxLines: 3, onEditingComplete: () { @@ -1445,9 +1445,9 @@ void main() { backgroundCursorColor: Colors.grey, controller: currentController, focusNode: focusNode, - style: Typography(platform: TargetPlatform.android) + style: Typography.material2018(platform: TargetPlatform.android) .black - .subhead, + .subtitle1, cursorColor: Colors.blue, selectionControls: materialTextSelectionControls, keyboardType: TextInputType.text, @@ -2552,7 +2552,7 @@ void main() { child: EditableText( controller: controller, focusNode: FocusNode(), - style: Typography(platform: TargetPlatform.android).black.subhead, + style: Typography.material2018(platform: TargetPlatform.android).black.subtitle1, cursorColor: Colors.blue, backgroundCursorColor: Colors.grey, ), @@ -2583,7 +2583,7 @@ void main() { child: EditableText( controller: controller, focusNode: FocusNode(), - style: Typography(platform: TargetPlatform.android).black.subhead, + style: Typography.material2018(platform: TargetPlatform.android).black.subtitle1, cursorColor: Colors.blue, backgroundCursorColor: Colors.grey, ), @@ -2629,7 +2629,7 @@ void main() { key: ValueKey(controller1.text), controller: controller1, focusNode: FocusNode(), - style: Typography(platform: TargetPlatform.android).black.subhead, + style: Typography.material2018(platform: TargetPlatform.android).black.subtitle1, cursorColor: Colors.blue, backgroundCursorColor: Colors.grey, ), @@ -2638,7 +2638,7 @@ void main() { key: ValueKey(controller2.text), controller: controller2, focusNode: FocusNode(), - style: Typography(platform: TargetPlatform.android).black.subhead, + style: Typography.material2018(platform: TargetPlatform.android).black.subtitle1, cursorColor: Colors.blue, backgroundCursorColor: Colors.grey, minLines: 10, @@ -2863,7 +2863,7 @@ void main() { child: EditableText( controller: controller, focusNode: FocusNode(), - style: Typography(platform: TargetPlatform.android).black.subhead, + style: Typography.material2018(platform: TargetPlatform.android).black.subtitle1, cursorColor: Colors.blue, backgroundCursorColor: Colors.grey, keyboardAppearance: Brightness.dark, @@ -2936,7 +2936,7 @@ void main() { showSelectionHandles: true, controller: controller, focusNode: FocusNode(), - style: Typography(platform: TargetPlatform.android).black.subhead, + style: Typography.material2018(platform: TargetPlatform.android).black.subtitle1, cursorColor: Colors.blue, backgroundCursorColor: Colors.grey, selectionControls: materialTextSelectionControls, @@ -3103,7 +3103,7 @@ void main() { controller: controller, showSelectionHandles: true, focusNode: FocusNode(), - style: Typography(platform: TargetPlatform.android).black.subhead, + style: Typography.material2018(platform: TargetPlatform.android).black.subtitle1, cursorColor: Colors.blue, backgroundCursorColor: Colors.grey, selectionControls: materialTextSelectionControls, @@ -3227,7 +3227,7 @@ void main() { showSelectionHandles: true, autofocus: true, focusNode: FocusNode(), - style: Typography(platform: TargetPlatform.android).black.subhead, + style: Typography.material2018(platform: TargetPlatform.android).black.subtitle1, cursorColor: Colors.blue, backgroundCursorColor: Colors.grey, selectionControls: materialTextSelectionControls, @@ -3774,7 +3774,7 @@ void main() { showSelectionHandles: true, controller: controller, focusNode: FocusNode(), - style: Typography(platform: TargetPlatform.iOS).black.subhead, + style: Typography.material2018(platform: TargetPlatform.iOS).black.subtitle1, cursorColor: Colors.blue, backgroundCursorColor: Colors.grey, selectionControls: cupertinoTextSelectionControls, @@ -3943,7 +3943,7 @@ void main() { maxLines: 2, controller: controller, focusNode: FocusNode(), - style: Typography(platform: TargetPlatform.android).black.subhead.copyWith(fontFamily: 'Roboto'), + style: Typography.material2018(platform: TargetPlatform.android).black.subtitle1.copyWith(fontFamily: 'Roboto'), cursorColor: Colors.blue, backgroundCursorColor: Colors.grey, selectionControls: materialTextSelectionControls, @@ -4020,7 +4020,7 @@ void main() { focusNode: FocusNode(), cursorColor: Colors.red, backgroundCursorColor: Colors.blue, - style: Typography(platform: TargetPlatform.android).black.subhead.copyWith(fontFamily: 'Roboto'), + style: Typography.material2018(platform: TargetPlatform.android).black.subtitle1.copyWith(fontFamily: 'Roboto'), keyboardType: TextInputType.text, ); @@ -4056,7 +4056,7 @@ void main() { focusNode: FocusNode(), cursorColor: Colors.red, backgroundCursorColor: Colors.blue, - style: Typography(platform: TargetPlatform.android).black.subhead.copyWith(fontFamily: 'Roboto'), + style: Typography.material2018(platform: TargetPlatform.android).black.subtitle1.copyWith(fontFamily: 'Roboto'), keyboardType: TextInputType.text, ); @@ -4101,7 +4101,7 @@ void main() { focusNode: FocusNode(), cursorColor: Colors.red, backgroundCursorColor: Colors.blue, - style: Typography(platform: TargetPlatform.android).black.subhead.copyWith(fontFamily: 'Roboto'), + style: Typography.material2018(platform: TargetPlatform.android).black.subtitle1.copyWith(fontFamily: 'Roboto'), keyboardType: TextInputType.text, ); @@ -4215,7 +4215,7 @@ class _TransformedEditableTextState extends State { child: EditableText( controller: TextEditingController(), focusNode: FocusNode(), - style: Typography(platform: TargetPlatform.android).black.subhead, + style: Typography.material2018(platform: TargetPlatform.android).black.subtitle1, cursorColor: Colors.blue, backgroundCursorColor: Colors.grey, ), diff --git a/packages/flutter/test/widgets/inherited_model_test.dart b/packages/flutter/test/widgets/inherited_model_test.dart index ff79f1205e0..ee2f6418ea6 100644 --- a/packages/flutter/test/widgets/inherited_model_test.dart +++ b/packages/flutter/test/widgets/inherited_model_test.dart @@ -227,7 +227,7 @@ void main() { final Widget showABC = Builder( builder: (BuildContext context) { final ABCModel abc = ABCModel.of(context); - return Text('a: ${abc.a} b: ${abc.b} c: ${abc.c}', style: Theme.of(context).textTheme.title); + return Text('a: ${abc.a} b: ${abc.b} c: ${abc.c}', style: Theme.of(context).textTheme.headline6); } ); @@ -344,7 +344,7 @@ void main() { final Widget showABC = Builder( builder: (BuildContext context) { final ABCModel abc = ABCModel.of(context); - return Text('a: ${abc.a} b: ${abc.b} c: ${abc.c}', style: Theme.of(context).textTheme.title); + return Text('a: ${abc.a} b: ${abc.b} c: ${abc.c}', style: Theme.of(context).textTheme.headline6); } ); diff --git a/packages/flutter/test/widgets/navigator_test.dart b/packages/flutter/test/widgets/navigator_test.dart index 9f87b52e581..39ab1a311b4 100644 --- a/packages/flutter/test/widgets/navigator_test.dart +++ b/packages/flutter/test/widgets/navigator_test.dart @@ -85,7 +85,7 @@ class OnTapPage extends StatelessWidget { behavior: HitTestBehavior.opaque, child: Container( child: Center( - child: Text(id, style: Theme.of(context).textTheme.display2), + child: Text(id, style: Theme.of(context).textTheme.headline3), ), ), ), diff --git a/packages/flutter/test/widgets/route_notification_messages_test.dart b/packages/flutter/test/widgets/route_notification_messages_test.dart index 6bb87fab97c..34ae56aa014 100644 --- a/packages/flutter/test/widgets/route_notification_messages_test.dart +++ b/packages/flutter/test/widgets/route_notification_messages_test.dart @@ -26,7 +26,7 @@ class OnTapPage extends StatelessWidget { behavior: HitTestBehavior.opaque, child: Container( child: Center( - child: Text(id, style: Theme.of(context).textTheme.display2), + child: Text(id, style: Theme.of(context).textTheme.headline3), ), ), ), diff --git a/packages/flutter_tools/templates/app/lib/main.dart.tmpl b/packages/flutter_tools/templates/app/lib/main.dart.tmpl index 40c8db18484..3af0983f09e 100644 --- a/packages/flutter_tools/templates/app/lib/main.dart.tmpl +++ b/packages/flutter_tools/templates/app/lib/main.dart.tmpl @@ -142,7 +142,7 @@ class _MyHomePageState extends State { ), Text( '$_counter', - style: Theme.of(context).textTheme.display1, + style: Theme.of(context).textTheme.headline4, ), ], ), diff --git a/packages/flutter_tools/templates/module/common/lib/main.dart.tmpl b/packages/flutter_tools/templates/module/common/lib/main.dart.tmpl index 87e6b51e752..d3461e82cbe 100644 --- a/packages/flutter_tools/templates/module/common/lib/main.dart.tmpl +++ b/packages/flutter_tools/templates/module/common/lib/main.dart.tmpl @@ -115,7 +115,7 @@ class _MyHomePageState extends State { ), Text( '$_counter', - style: Theme.of(context).textTheme.display1, + style: Theme.of(context).textTheme.headline4, ), ], ), diff --git a/packages/flutter_tools/test/commands.shard/permeable/analyze_once_test.dart b/packages/flutter_tools/test/commands.shard/permeable/analyze_once_test.dart index 5d988d012c0..4eaffa2970b 100644 --- a/packages/flutter_tools/test/commands.shard/permeable/analyze_once_test.dart +++ b/packages/flutter_tools/test/commands.shard/permeable/analyze_once_test.dart @@ -342,7 +342,7 @@ class _MyHomePageState extends State { ), Text( '$_counter', - style: Theme.of(context).textTheme.display1, + style: Theme.of(context).textTheme.headline4, ), ], ),