Migrate TextTheme to 2018 APIs (#48547)
This commit is contained in:
committed by
Flutter GitHub Bot
parent
77fb0c1ade
commit
bc5c46438a
@@ -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,
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user