mirror of
https://github.com/flutter/flutter.git
synced 2025-06-03 00:51:18 +00:00
Migrate TextTheme to 2018 APIs (#48547)
This commit is contained in:
parent
77fb0c1ade
commit
bc5c46438a
@ -363,7 +363,7 @@ class UserHeader extends StatelessWidget {
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: <Widget>[
|
||||
RichText(text: TextSpan(
|
||||
style: Theme.of(context).textTheme.body1,
|
||||
style: Theme.of(context).textTheme.bodyText2,
|
||||
children: <TextSpan>[
|
||||
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: <Widget>[
|
||||
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)),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
@ -100,7 +100,7 @@ class _MyHomePageState extends State<MyHomePage> {
|
||||
),
|
||||
Text(
|
||||
'$_counter',
|
||||
style: Theme.of(context).textTheme.display1,
|
||||
style: Theme.of(context).textTheme.headline4,
|
||||
),
|
||||
],
|
||||
),
|
||||
|
@ -100,7 +100,7 @@ class _MyHomePageState extends State<MyHomePage> {
|
||||
),
|
||||
Text(
|
||||
'$_counter',
|
||||
style: Theme.of(context).textTheme.display1,
|
||||
style: Theme.of(context).textTheme.headline4,
|
||||
),
|
||||
],
|
||||
),
|
||||
|
@ -100,7 +100,7 @@ class _MyHomePageState extends State<MyHomePage> {
|
||||
),
|
||||
Text(
|
||||
'$_counter',
|
||||
style: Theme.of(context).textTheme.display1,
|
||||
style: Theme.of(context).textTheme.headline4,
|
||||
),
|
||||
],
|
||||
),
|
||||
|
@ -446,7 +446,7 @@ class _FocusDemoState extends State<FocusDemo> {
|
||||
debugLabel: 'Scope',
|
||||
autofocus: true,
|
||||
child: DefaultTextStyle(
|
||||
style: textTheme.display1,
|
||||
style: textTheme.headline4,
|
||||
child: Scaffold(
|
||||
appBar: AppBar(
|
||||
title: const Text('Actions Demo'),
|
||||
|
@ -240,7 +240,7 @@ class CardCollectionState extends State<CardCollection> {
|
||||
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<CardCollection> {
|
||||
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
|
||||
|
@ -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,
|
||||
|
@ -149,7 +149,7 @@ class _FocusDemoState extends State<FocusDemo> {
|
||||
onKey: _handleKeyPress,
|
||||
autofocus: true,
|
||||
child: DefaultTextStyle(
|
||||
style: textTheme.display1,
|
||||
style: textTheme.headline4,
|
||||
child: Scaffold(
|
||||
appBar: AppBar(
|
||||
title: const Text('Focus Demo'),
|
||||
|
@ -56,7 +56,7 @@ class _HoverDemoState extends State<HoverDemo> {
|
||||
final TextTheme textTheme = Theme.of(context).textTheme;
|
||||
|
||||
return DefaultTextStyle(
|
||||
style: textTheme.display1,
|
||||
style: textTheme.headline4,
|
||||
child: Scaffold(
|
||||
appBar: AppBar(
|
||||
title: const Text('Hover Demo'),
|
||||
|
@ -79,12 +79,12 @@ class _HardwareKeyDemoState extends State<RawKeyboardDemo> {
|
||||
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<RawKeyboardDemo> {
|
||||
}
|
||||
}
|
||||
return DefaultTextStyle(
|
||||
style: textTheme.subhead,
|
||||
style: textTheme.subtitle1,
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: dataText,
|
||||
|
@ -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,
|
||||
|
@ -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(
|
||||
|
@ -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(
|
||||
|
@ -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(
|
||||
|
@ -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(
|
||||
|
@ -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,
|
||||
|
@ -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,
|
||||
|
@ -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,
|
||||
|
@ -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<double> animation = listenable as Animation<double>;
|
||||
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<BackdropDemo> with SingleTickerProviderSt
|
||||
children: <Widget>[
|
||||
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(
|
||||
|
@ -253,7 +253,7 @@ class _RadioItem<T> 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,
|
||||
),
|
||||
),
|
||||
|
@ -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,
|
||||
|
@ -291,7 +291,7 @@ class _ChipDemoState extends State<ChipDemo> {
|
||||
child: Center(
|
||||
child: Text(
|
||||
_createResult(),
|
||||
style: theme.textTheme.title,
|
||||
style: theme.textTheme.headline6,
|
||||
),
|
||||
),
|
||||
),
|
||||
|
@ -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: <Widget>[
|
||||
@ -149,13 +149,13 @@ class _DateAndTimePickerDemoState extends State<DateAndTimePickerDemo> {
|
||||
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',
|
||||
|
@ -83,7 +83,7 @@ class DialogDemoState extends State<DialogDemo> {
|
||||
@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,
|
||||
|
@ -234,7 +234,7 @@ class _DrawerDemoState extends State<DrawerDemo> 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,
|
||||
),
|
||||
),
|
||||
],
|
||||
|
@ -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),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
@ -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: <Widget>[
|
||||
Expanded(
|
||||
@ -115,7 +115,7 @@ class FullScreenDialogDemoState extends State<FullScreenDialogDemo> {
|
||||
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<bool>(
|
||||
context: context,
|
||||
@ -153,7 +153,7 @@ class FullScreenDialogDemoState extends State<FullScreenDialogDemo> {
|
||||
title: Text(_hasName ? _eventName : 'Event Name TBD'),
|
||||
actions: <Widget> [
|
||||
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<FullScreenDialogDemo> {
|
||||
labelText: 'Event name',
|
||||
filled: true,
|
||||
),
|
||||
style: theme.textTheme.headline,
|
||||
style: theme.textTheme.headline5,
|
||||
onChanged: (String value) {
|
||||
setState(() {
|
||||
_hasName = value.isNotEmpty;
|
||||
|
@ -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,
|
||||
|
@ -109,7 +109,7 @@ class _ProgressIndicatorDemoState extends State<ProgressIndicatorDemo> 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,
|
||||
|
@ -207,7 +207,7 @@ class _ListDemoState extends State<ReorderableListDemo> {
|
||||
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,
|
||||
|
@ -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>[
|
||||
TextSpan(
|
||||
text: suggestion.substring(query.length),
|
||||
style: theme.textTheme.subhead,
|
||||
style: theme.textTheme.subtitle1,
|
||||
),
|
||||
],
|
||||
),
|
||||
|
@ -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,
|
||||
|
@ -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,
|
||||
),
|
||||
),
|
||||
],
|
||||
|
@ -76,7 +76,7 @@ class _TabsFabDemoState extends State<TabsFabDemo> 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),
|
||||
),
|
||||
);
|
||||
});
|
||||
|
@ -30,10 +30,10 @@ class TooltipDemo extends StatelessWidget {
|
||||
bottom: false,
|
||||
child: ListView(
|
||||
children: <Widget>[
|
||||
Text(_introText, style: theme.textTheme.subhead),
|
||||
Text(_introText, style: theme.textTheme.subtitle1),
|
||||
Row(
|
||||
children: <Widget>[
|
||||
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(
|
||||
|
@ -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',
|
||||
|
@ -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: <Widget>[
|
||||
|
@ -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,
|
||||
|
@ -50,7 +50,7 @@ class _LoginPageState extends State<LoginPage> {
|
||||
const SizedBox(height: 16.0),
|
||||
Text(
|
||||
'SHRINE',
|
||||
style: Theme.of(context).textTheme.headline,
|
||||
style: Theme.of(context).textTheme.headline5,
|
||||
),
|
||||
],
|
||||
),
|
||||
|
@ -57,7 +57,7 @@ class _ShoppingCartPageState extends State<ShoppingCartPage> {
|
||||
),
|
||||
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),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
@ -49,15 +49,15 @@ class TypographyDemo extends StatelessWidget {
|
||||
final TextTheme textTheme = Theme.of(context).textTheme;
|
||||
final List<Widget> styleItems = <Widget>[
|
||||
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'),
|
||||
];
|
||||
|
@ -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,
|
||||
|
@ -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(
|
||||
|
@ -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),
|
||||
|
@ -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: <Widget>[
|
||||
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)
|
||||
),
|
||||
),
|
||||
|
@ -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: <Widget>[
|
||||
|
@ -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',
|
||||
),
|
||||
);
|
||||
|
@ -49,7 +49,7 @@ class UpdaterState extends State<Updater> {
|
||||
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),
|
||||
|
@ -202,7 +202,7 @@ class _MyHomePageState extends State<MyHomePage> with TickerProviderStateMixin {
|
||||
),
|
||||
Text(
|
||||
'$_counter',
|
||||
style: Theme.of(context).textTheme.display1,
|
||||
style: Theme.of(context).textTheme.headline4,
|
||||
),
|
||||
],
|
||||
),
|
||||
|
@ -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<String>('${stock.symbol}_symbol_name'),
|
||||
style: Theme.of(context).textTheme.display2,
|
||||
style: Theme.of(context).textTheme.headline3,
|
||||
),
|
||||
arrow,
|
||||
],
|
||||
|
@ -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!
|
||||
/// ),
|
||||
/// ),
|
||||
|
@ -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<Widget> aboutBoxChildren = <Widget>[
|
||||
/// SizedBox(height: 24),
|
||||
/// RichText(
|
||||
@ -374,8 +374,8 @@ class AboutDialog extends StatelessWidget {
|
||||
padding: const EdgeInsets.symmetric(horizontal: 24.0),
|
||||
child: ListBody(
|
||||
children: <Widget>[
|
||||
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<LicensePage> {
|
||||
child: ListView(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 8.0, vertical: 12.0),
|
||||
children: <Widget>[
|
||||
Text(name, style: Theme.of(context).textTheme.headline, textAlign: TextAlign.center),
|
||||
Text(name, style: Theme.of(context).textTheme.headline5, textAlign: TextAlign.center),
|
||||
if (icon != null) IconTheme(data: Theme.of(context).iconTheme, child: icon),
|
||||
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)
|
||||
|
@ -434,12 +434,12 @@ class _AppBarState extends State<AppBar> {
|
||||
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);
|
||||
|
@ -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,
|
||||
|
@ -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));
|
||||
|
@ -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)) {
|
||||
|
@ -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<YearPicker> {
|
||||
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<YearPicker> {
|
||||
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<int>(year),
|
||||
|
@ -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),
|
||||
),
|
||||
),
|
||||
|
@ -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
|
||||
|
@ -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,
|
||||
|
@ -958,7 +958,7 @@ class DropdownButton<T> 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<T> extends State<DropdownButton<T>> with WidgetsBindi
|
||||
}
|
||||
}
|
||||
|
||||
TextStyle get _textStyle => widget.style ?? Theme.of(context).textTheme.subhead;
|
||||
TextStyle get _textStyle => widget.style ?? Theme.of(context).textTheme.subtitle1;
|
||||
|
||||
void _handleTap() {
|
||||
final RenderBox itemBox = context.findRenderObject() as RenderBox;
|
||||
@ -1184,7 +1184,7 @@ class _DropdownButtonState<T> extends State<DropdownButton<T>> with WidgetsBindi
|
||||
// Similarly, we don't reduce the height of the button so much that its icon
|
||||
// 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));
|
||||
}
|
||||
|
||||
|
@ -191,7 +191,7 @@ class _ExpansionTileState extends State<ExpansionTile> with SingleTickerProvider
|
||||
_borderColorTween
|
||||
..end = theme.dividerColor;
|
||||
_headerColorTween
|
||||
..begin = theme.textTheme.subhead.color
|
||||
..begin = theme.textTheme.subtitle1.color
|
||||
..end = theme.accentColor;
|
||||
_iconColorTween
|
||||
..begin = theme.unselectedWidgetColor
|
||||
|
@ -367,7 +367,7 @@ class _FlexibleSpaceBarState extends State<FlexibleSpaceBar> {
|
||||
|
||||
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)
|
||||
);
|
||||
|
@ -93,7 +93,7 @@ class GridTileBar extends StatelessWidget {
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
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,
|
||||
|
@ -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<InputDecorator> 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<InputDecorator> 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);
|
||||
|
@ -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)
|
||||
|
@ -351,7 +351,7 @@ class _MaterialState extends State<Material> 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,
|
||||
);
|
||||
|
@ -439,8 +439,8 @@ class PaginatedDataTableState extends State<PaginatedDataTable> {
|
||||
// These typographic styles aren't quite the regular ones. We pick the closest ones from the regular
|
||||
// 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
|
||||
|
@ -239,7 +239,7 @@ class PopupMenuItem<T> extends PopupMenuEntry<T> {
|
||||
/// 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<T, W extends PopupMenuItem<T>> extends State<W> {
|
||||
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);
|
||||
|
@ -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<RangeSlider> 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,
|
||||
|
@ -510,7 +510,7 @@ class _SearchPageState<T> extends State<_SearchPage<T>> {
|
||||
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 _) {
|
||||
|
@ -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<Slider> 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,
|
||||
),
|
||||
);
|
||||
|
@ -360,7 +360,7 @@ class _SnackBarState extends State<SnackBar> {
|
||||
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;
|
||||
|
@ -444,13 +444,13 @@ class _StepperState extends State<Stepper> 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
|
||||
);
|
||||
}
|
||||
|
@ -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}
|
||||
|
@ -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<TextField> 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;
|
||||
|
@ -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.
|
||||
///
|
||||
/// 
|
||||
///
|
||||
/// ## 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.
|
||||
///
|
||||
/// 
|
||||
/// 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<TextStyle>('display4', display4, defaultValue: defaultTheme.display4));
|
||||
properties.add(DiagnosticsProperty<TextStyle>('display3', display3, defaultValue: defaultTheme.display3));
|
||||
properties.add(DiagnosticsProperty<TextStyle>('display2', display2, defaultValue: defaultTheme.display2));
|
||||
properties.add(DiagnosticsProperty<TextStyle>('display1', display1, defaultValue: defaultTheme.display1));
|
||||
properties.add(DiagnosticsProperty<TextStyle>('headline', headline, defaultValue: defaultTheme.headline));
|
||||
properties.add(DiagnosticsProperty<TextStyle>('title', title, defaultValue: defaultTheme.title));
|
||||
properties.add(DiagnosticsProperty<TextStyle>('subhead', subhead, defaultValue: defaultTheme.subhead));
|
||||
properties.add(DiagnosticsProperty<TextStyle>('body2', body2, defaultValue: defaultTheme.body2));
|
||||
properties.add(DiagnosticsProperty<TextStyle>('body1', body1, defaultValue: defaultTheme.body1));
|
||||
final TextTheme defaultTheme = Typography.material2018(platform: defaultTargetPlatform).black;
|
||||
properties.add(DiagnosticsProperty<TextStyle>('headline1', headline1, defaultValue: defaultTheme.headline1));
|
||||
properties.add(DiagnosticsProperty<TextStyle>('headline2', headline2, defaultValue: defaultTheme.headline2));
|
||||
properties.add(DiagnosticsProperty<TextStyle>('headline3', headline3, defaultValue: defaultTheme.headline3));
|
||||
properties.add(DiagnosticsProperty<TextStyle>('headline4', headline4, defaultValue: defaultTheme.headline4));
|
||||
properties.add(DiagnosticsProperty<TextStyle>('headline5', headline5, defaultValue: defaultTheme.headline5));
|
||||
properties.add(DiagnosticsProperty<TextStyle>('headline6', headline6, defaultValue: defaultTheme.headline6));
|
||||
properties.add(DiagnosticsProperty<TextStyle>('subtitle1', subtitle1, defaultValue: defaultTheme.subtitle1));
|
||||
properties.add(DiagnosticsProperty<TextStyle>('subtitle2', subtitle2, defaultValue: defaultTheme.subtitle2));
|
||||
properties.add(DiagnosticsProperty<TextStyle>('bodyText1', bodyText1, defaultValue: defaultTheme.bodyText1));
|
||||
properties.add(DiagnosticsProperty<TextStyle>('bodyText2', bodyText2, defaultValue: defaultTheme.bodyText2));
|
||||
properties.add(DiagnosticsProperty<TextStyle>('caption', caption, defaultValue: defaultTheme.caption));
|
||||
properties.add(DiagnosticsProperty<TextStyle>('button', button, defaultValue: defaultTheme.button));
|
||||
properties.add(DiagnosticsProperty<TextStyle>('subtitle)', subtitle, defaultValue: defaultTheme.subtitle));
|
||||
properties.add(DiagnosticsProperty<TextStyle>('overline', overline, defaultValue: defaultTheme.overline));
|
||||
}
|
||||
}
|
||||
|
@ -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,
|
||||
/// ),
|
||||
/// );
|
||||
/// },
|
||||
|
@ -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.
|
||||
///
|
||||
/// 
|
||||
@ -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();
|
||||
|
@ -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,
|
||||
|
@ -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(
|
||||
|
@ -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<Tooltip> 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<Tooltip> 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,
|
||||
|
@ -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<TextTheme>('black', black, defaultValue: defaultTypography.black));
|
||||
properties.add(DiagnosticsProperty<TextTheme>('white', white, defaultValue: defaultTypography.white));
|
||||
properties.add(DiagnosticsProperty<TextTheme>('englishLike', englishLike, defaultValue: defaultTypography.englishLike));
|
||||
@ -268,18 +332,18 @@ 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),
|
||||
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),
|
||||
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),
|
||||
);
|
||||
|
||||
@ -287,18 +351,18 @@ class Typography extends Diagnosticable {
|
||||
///
|
||||
/// 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),
|
||||
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),
|
||||
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),
|
||||
);
|
||||
|
||||
@ -306,18 +370,18 @@ class Typography extends Diagnosticable {
|
||||
///
|
||||
/// 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),
|
||||
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),
|
||||
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),
|
||||
);
|
||||
|
||||
@ -325,36 +389,36 @@ class Typography extends Diagnosticable {
|
||||
///
|
||||
/// 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),
|
||||
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),
|
||||
subtitle : TextStyle(debugLabel: 'whiteCupertino subtitle', fontFamily: '.SF UI Text', inherit: true, color: Colors.white, decoration: TextDecoration.none),
|
||||
subtitle2 : TextStyle(debugLabel: 'whiteCupertino subtitle2', fontFamily: '.SF UI Text', inherit: true, color: Colors.white, decoration: TextDecoration.none),
|
||||
overline : TextStyle(debugLabel: 'whiteCupertino overline', fontFamily: '.SF UI Text', inherit: true, color: Colors.white, decoration: TextDecoration.none),
|
||||
);
|
||||
|
||||
/// 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),
|
||||
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),
|
||||
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),
|
||||
);
|
||||
|
||||
@ -364,36 +428,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 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),
|
||||
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),
|
||||
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),
|
||||
);
|
||||
|
||||
/// 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),
|
||||
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),
|
||||
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),
|
||||
);
|
||||
|
||||
@ -403,35 +467,35 @@ 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),
|
||||
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),
|
||||
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),
|
||||
);
|
||||
|
||||
@ -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),
|
||||
);
|
||||
}
|
||||
|
@ -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,
|
||||
),
|
||||
|
@ -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,
|
||||
|
@ -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<AnimatedList> with TickerProviderStateMixi
|
||||
/// child: Center(
|
||||
/// child: Text(
|
||||
/// 'Item $item',
|
||||
/// style: Theme.of(context).textTheme.display1,
|
||||
/// style: Theme.of(context).textTheme.headline4,
|
||||
/// ),
|
||||
/// ),
|
||||
/// ),
|
||||
|
@ -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<int>(_count),
|
||||
/// style: Theme.of(context).textTheme.display1,
|
||||
/// style: Theme.of(context).textTheme.headline4,
|
||||
/// ),
|
||||
/// ),
|
||||
/// RaisedButton(
|
||||
|
@ -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)})',
|
||||
|
@ -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),
|
||||
/// )
|
||||
|
@ -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(),
|
||||
/// );
|
||||
/// }
|
||||
|
@ -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',
|
||||
|
@ -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,
|
||||
|
@ -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)),
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -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 {
|
||||
|
@ -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),
|
||||
|
@ -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 {
|
||||
|
@ -175,7 +175,7 @@ void main() {
|
||||
title: Text(titleText),
|
||||
actions: <Widget>[ ],
|
||||
);
|
||||
final ThemeData theme = ThemeData(textTheme: const TextTheme(title: titleTextStyle));
|
||||
final ThemeData theme = ThemeData(textTheme: const TextTheme(headline6: titleTextStyle));
|
||||
|
||||
await tester.pumpWidget(_appWithAlertDialog(tester, dialog, theme: theme));
|
||||
await tester.tap(find.text('X'));
|
||||
@ -226,7 +226,7 @@ void main() {
|
||||
content: Text(contentText),
|
||||
actions: <Widget>[ ],
|
||||
);
|
||||
final ThemeData theme = ThemeData(textTheme: const TextTheme(subhead: contentTextStyle));
|
||||
final ThemeData theme = ThemeData(textTheme: const TextTheme(subtitle1: contentTextStyle));
|
||||
|
||||
await tester.pumpWidget(_appWithAlertDialog(tester, dialog, theme: theme));
|
||||
await tester.tap(find.text('X'));
|
||||
|
@ -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(
|
||||
|
@ -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();
|
||||
|
@ -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,
|
||||
),
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user