Deprecate 2018 text theme parameters (#109817)

This commit is contained in:
Kate Lovett
2022-08-22 15:00:34 -05:00
committed by GitHub
parent 717d92e802
commit 7e12b37111
151 changed files with 1112 additions and 609 deletions

View File

@@ -155,7 +155,7 @@ class _MyStatefulWidgetState extends State<MyStatefulWidget> {
return Padding(
padding: const EdgeInsets.all(8.0),
child: Text('${model.data.value}',
style: Theme.of(context).textTheme.headline4),
style: Theme.of(context).textTheme.headlineMedium),
);
}),
IconButton(

View File

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

View File

@@ -224,7 +224,7 @@ class CardItem extends StatelessWidget {
child: Center(
child: Text(
'Item $item',
style: Theme.of(context).textTheme.headline4,
style: Theme.of(context).textTheme.headlineMedium,
),
),
),

View File

@@ -50,7 +50,7 @@ class _MyStatefulWidgetState extends State<MyStatefulWidget> {
// 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.headline4,
style: Theme.of(context).textTheme.headlineMedium,
),
),
ElevatedButton(

View File

@@ -38,7 +38,7 @@ class _MyStatefulWidgetState extends State<MyStatefulWidget> {
@override
Widget build(BuildContext context) {
return DefaultTextStyle(
style: Theme.of(context).textTheme.headline2!,
style: Theme.of(context).textTheme.displayMedium!,
textAlign: TextAlign.center,
child: FutureBuilder<String>(
future: _calculation, // a previously-obtained Future<String> or null

View File

@@ -48,7 +48,7 @@ class _MyStatefulWidgetState extends State<MyStatefulWidget> {
@override
Widget build(BuildContext context) {
return DefaultTextStyle(
style: Theme.of(context).textTheme.headline2!,
style: Theme.of(context).textTheme.displayMedium!,
textAlign: TextAlign.center,
child: Container(
alignment: FractionalOffset.center,

View File

@@ -78,7 +78,7 @@ class _MyStatefulWidgetState extends State<MyStatefulWidget> {
'You have pressed or released in this area this many times:'),
Text(
'$_downCounter presses\n$_upCounter releases',
style: Theme.of(context).textTheme.headline4,
style: Theme.of(context).textTheme.headlineMedium,
),
Text(
'The cursor is here: (${x.toStringAsFixed(2)}, ${y.toStringAsFixed(2)})',

View File

@@ -76,7 +76,7 @@ class _MyStatefulWidgetState extends State<MyStatefulWidget> {
'You have entered or exited this box this many times:'),
Text(
'$_enterCounter Entries\n$_exitCounter Exits',
style: Theme.of(context).textTheme.headline4,
style: Theme.of(context).textTheme.headlineMedium,
),
Text(
'The cursor is here: (${x.toStringAsFixed(2)}, ${y.toStringAsFixed(2)})',

View File

@@ -121,7 +121,7 @@ class MyStatelessWidget extends StatelessWidget {
Widget build(BuildContext context) {
final TextTheme textTheme = Theme.of(context).textTheme;
return DefaultTextStyle(
style: textTheme.headline4!,
style: textTheme.headlineMedium!,
child: const ColorfulButton(),
);
}

View File

@@ -69,7 +69,7 @@ class _MyStatefulWidgetState extends State<MyStatefulWidget> {
debugLabel: 'Scope',
autofocus: true,
child: DefaultTextStyle(
style: textTheme.headline4!,
style: textTheme.headlineMedium!,
child: Focus(
onKey: _handleKeyPress,
debugLabel: 'Button',

View File

@@ -119,7 +119,7 @@ class _MyStatefulWidgetState extends State<MyStatefulWidget> {
child: const Text('ANOTHER BUTTON TO FOCUS'),
),
DefaultTextStyle(
style: Theme.of(context).textTheme.headline2!,
style: Theme.of(context).textTheme.displayMedium!,
child: const Text('BACKDROP')),
],
),
@@ -148,7 +148,7 @@ class _MyStatefulWidgetState extends State<MyStatefulWidget> {
? null
: () => setState(() => backdropIsVisible = true),
child: DefaultTextStyle(
style: Theme.of(context).textTheme.headline2!,
style: Theme.of(context).textTheme.displayMedium!,
child: const Text('FOREGROUND')),
),
),

View File

@@ -31,7 +31,7 @@ class HomePage extends StatelessWidget {
@override
Widget build(BuildContext context) {
return DefaultTextStyle(
style: Theme.of(context).textTheme.headline4!,
style: Theme.of(context).textTheme.headlineMedium!,
child: Container(
color: Colors.white,
alignment: Alignment.center,
@@ -47,7 +47,7 @@ class CollectPersonalInfoPage extends StatelessWidget {
@override
Widget build(BuildContext context) {
return DefaultTextStyle(
style: Theme.of(context).textTheme.headline4!,
style: Theme.of(context).textTheme.headlineMedium!,
child: GestureDetector(
onTap: () {
// This moves from the personal info page to the credentials page,
@@ -78,7 +78,7 @@ class ChooseCredentialsPage extends StatelessWidget {
return GestureDetector(
onTap: onSignupComplete,
child: DefaultTextStyle(
style: Theme.of(context).textTheme.headline4!,
style: Theme.of(context).textTheme.headlineMedium!,
child: Container(
color: Colors.pinkAccent,
alignment: Alignment.center,

View File

@@ -82,7 +82,7 @@ class _RestorableCounterState extends State<RestorableCounter>
),
Text(
'${_counter.value}',
style: Theme.of(context).textTheme.headline4,
style: Theme.of(context).textTheme.headlineMedium,
),
],
),

View File

@@ -28,7 +28,7 @@ class MyStatelessWidget extends StatelessWidget {
@override
Widget build(BuildContext context) {
return DefaultTextStyle(
style: Theme.of(context).textTheme.bodyText2!,
style: Theme.of(context).textTheme.bodyMedium!,
child: LayoutBuilder(
builder: (BuildContext context, BoxConstraints viewportConstraints) {
return SingleChildScrollView(

View File

@@ -28,7 +28,7 @@ class MyStatelessWidget extends StatelessWidget {
@override
Widget build(BuildContext context) {
return DefaultTextStyle(
style: Theme.of(context).textTheme.bodyText2!,
style: Theme.of(context).textTheme.bodyMedium!,
child: LayoutBuilder(
builder: (BuildContext context, BoxConstraints viewportConstraints) {
return SingleChildScrollView(