Skip to content

Commit bc5c464

Browse files
HansMullerfluttergithubbot
authored andcommitted
Migrate TextTheme to 2018 APIs (flutter#48547)
1 parent 77fb0c1 commit bc5c464

File tree

118 files changed

+1127
-738
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

118 files changed

+1127
-738
lines changed

dev/benchmarks/complex_layout/lib/main.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ class UserHeader extends StatelessWidget {
363363
crossAxisAlignment: CrossAxisAlignment.stretch,
364364
children: <Widget>[
365365
RichText(text: TextSpan(
366-
style: Theme.of(context).textTheme.body1,
366+
style: Theme.of(context).textTheme.bodyText2,
367367
children: <TextSpan>[
368368
TextSpan(text: userName, style: const TextStyle(fontWeight: FontWeight.bold)),
369369
const TextSpan(text: ' shared a new '),
@@ -462,8 +462,8 @@ class ItemImageBox extends StatelessWidget {
462462
child: Column(
463463
crossAxisAlignment: CrossAxisAlignment.stretch,
464464
children: <Widget>[
465-
Text('Artisans of Southern India', style: Theme.of(context).textTheme.body2),
466-
Text('Silk Spinners', style: Theme.of(context).textTheme.body1),
465+
Text('Artisans of Southern India', style: Theme.of(context).textTheme.bodyText1),
466+
Text('Silk Spinners', style: Theme.of(context).textTheme.bodyText2),
467467
Text('Sivaganga, Tamil Nadu', style: Theme.of(context).textTheme.caption),
468468
],
469469
),
@@ -506,7 +506,7 @@ class ItemGalleryBox extends StatelessWidget {
506506
child: Container(
507507
color: Theme.of(context).primaryColor,
508508
child: Center(
509-
child: Text(tabName, style: Theme.of(context).textTheme.headline.copyWith(color: Colors.white)),
509+
child: Text(tabName, style: Theme.of(context).textTheme.headline5.copyWith(color: Colors.white)),
510510
),
511511
),
512512
),

dev/integration_tests/android_splash_screens/splash_screen_kitchen_sink/lib/main.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ class _MyHomePageState extends State<MyHomePage> {
100100
),
101101
Text(
102102
'$_counter',
103-
style: Theme.of(context).textTheme.display1,
103+
style: Theme.of(context).textTheme.headline4,
104104
),
105105
],
106106
),

dev/integration_tests/android_splash_screens/splash_screen_load_rotate/lib/main.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ class _MyHomePageState extends State<MyHomePage> {
100100
),
101101
Text(
102102
'$_counter',
103-
style: Theme.of(context).textTheme.display1,
103+
style: Theme.of(context).textTheme.headline4,
104104
),
105105
],
106106
),

dev/integration_tests/android_splash_screens/splash_screen_trans_rotate/lib/main.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ class _MyHomePageState extends State<MyHomePage> {
100100
),
101101
Text(
102102
'$_counter',
103-
style: Theme.of(context).textTheme.display1,
103+
style: Theme.of(context).textTheme.headline4,
104104
),
105105
],
106106
),

dev/manual_tests/lib/actions.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,7 @@ class _FocusDemoState extends State<FocusDemo> {
446446
debugLabel: 'Scope',
447447
autofocus: true,
448448
child: DefaultTextStyle(
449-
style: textTheme.display1,
449+
style: textTheme.headline4,
450450
child: Scaffold(
451451
appBar: AppBar(
452452
title: const Text('Actions Demo'),

dev/manual_tests/lib/card_collection.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ class CardCollectionState extends State<CardCollection> {
240240
padding: const EdgeInsets.only(left: 72.0),
241241
height: 128.0,
242242
alignment: const Alignment(-1.0, 0.5),
243-
child: Text('Swipe Away: ${_cardModels.length}', style: Theme.of(context).primaryTextTheme.title),
243+
child: Text('Swipe Away: ${_cardModels.length}', style: Theme.of(context).primaryTextTheme.headline6),
244244
),
245245
);
246246
}
@@ -305,7 +305,7 @@ class CardCollectionState extends State<CardCollection> {
305305
rightArrowIcon = Opacity(opacity: 0.1, child: rightArrowIcon);
306306

307307
final ThemeData theme = Theme.of(context);
308-
final TextStyle backgroundTextStyle = theme.primaryTextTheme.title;
308+
final TextStyle backgroundTextStyle = theme.primaryTextTheme.headline6;
309309

310310
// The background Widget appears behind the Dismissible card when the card
311311
// moves to the left or right. The Positioned widget ensures that the

dev/manual_tests/lib/drag_and_drop.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ class ExampleDragSource extends StatelessWidget {
100100
size *= kHeavyMultiplier;
101101

102102
final Widget contents = DefaultTextStyle(
103-
style: Theme.of(context).textTheme.body1,
103+
style: Theme.of(context).textTheme.bodyText2,
104104
textAlign: TextAlign.center,
105105
child: Dot(
106106
color: color,
@@ -188,7 +188,7 @@ class MovableBall extends StatelessWidget {
188188
@override
189189
Widget build(BuildContext context) {
190190
final Widget ball = DefaultTextStyle(
191-
style: Theme.of(context).primaryTextTheme.body1,
191+
style: Theme.of(context).primaryTextTheme.bodyText2,
192192
textAlign: TextAlign.center,
193193
child: Dot(
194194
key: kBallKey,

dev/manual_tests/lib/focus.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ class _FocusDemoState extends State<FocusDemo> {
149149
onKey: _handleKeyPress,
150150
autofocus: true,
151151
child: DefaultTextStyle(
152-
style: textTheme.display1,
152+
style: textTheme.headline4,
153153
child: Scaffold(
154154
appBar: AppBar(
155155
title: const Text('Focus Demo'),

dev/manual_tests/lib/hover.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ class _HoverDemoState extends State<HoverDemo> {
5656
final TextTheme textTheme = Theme.of(context).textTheme;
5757

5858
return DefaultTextStyle(
59-
style: textTheme.display1,
59+
style: textTheme.headline4,
6060
child: Scaffold(
6161
appBar: AppBar(
6262
title: const Text('Hover Demo'),

dev/manual_tests/lib/raw_keyboard.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,12 +79,12 @@ class _HardwareKeyDemoState extends State<RawKeyboardDemo> {
7979
onTap: () {
8080
_focusNode.requestFocus();
8181
},
82-
child: Text('Tap to focus', style: textTheme.display1),
82+
child: Text('Tap to focus', style: textTheme.headline4),
8383
);
8484
}
8585

8686
if (_event == null) {
87-
return Text('Press a key', style: textTheme.display1);
87+
return Text('Press a key', style: textTheme.headline4);
8888
}
8989

9090
final RawKeyEventData data = _event.data;
@@ -137,7 +137,7 @@ class _HardwareKeyDemoState extends State<RawKeyboardDemo> {
137137
}
138138
}
139139
return DefaultTextStyle(
140-
style: textTheme.subhead,
140+
style: textTheme.subtitle1,
141141
child: Column(
142142
mainAxisAlignment: MainAxisAlignment.center,
143143
children: dataText,

0 commit comments

Comments
 (0)