Deprecate 2018 text theme parameters (#109817)
This commit is contained in:
@@ -425,7 +425,7 @@ class _FocusDemoState extends State<FocusDemo> {
|
||||
debugLabel: 'Scope',
|
||||
autofocus: true,
|
||||
child: DefaultTextStyle(
|
||||
style: textTheme.headline4!,
|
||||
style: textTheme.headlineMedium!,
|
||||
child: Scaffold(
|
||||
appBar: AppBar(
|
||||
title: const Text('Actions Demo'),
|
||||
|
||||
@@ -243,7 +243,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.headline6),
|
||||
child: Text('Swipe Away: ${_cardModels.length}', style: Theme.of(context).primaryTextTheme.titleLarge),
|
||||
),
|
||||
);
|
||||
}
|
||||
@@ -314,7 +314,7 @@ class CardCollectionState extends State<CardCollection> {
|
||||
}
|
||||
|
||||
final ThemeData theme = Theme.of(context);
|
||||
final TextStyle? backgroundTextStyle = theme.primaryTextTheme.headline6;
|
||||
final TextStyle? backgroundTextStyle = theme.primaryTextTheme.titleLarge;
|
||||
|
||||
// The background Widget appears behind the Dismissible card when the card
|
||||
// moves to the left or right. The Positioned widget ensures that the
|
||||
|
||||
@@ -101,7 +101,7 @@ class ExampleDragSource extends StatelessWidget {
|
||||
}
|
||||
|
||||
final Widget contents = DefaultTextStyle(
|
||||
style: Theme.of(context).textTheme.bodyText2!,
|
||||
style: Theme.of(context).textTheme.bodyMedium!,
|
||||
textAlign: TextAlign.center,
|
||||
child: Dot(
|
||||
color: color,
|
||||
@@ -190,7 +190,7 @@ class MovableBall extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final Widget ball = DefaultTextStyle(
|
||||
style: Theme.of(context).primaryTextTheme.bodyText2!,
|
||||
style: Theme.of(context).primaryTextTheme.bodyMedium!,
|
||||
textAlign: TextAlign.center,
|
||||
child: Dot(
|
||||
key: kBallKey,
|
||||
|
||||
@@ -138,7 +138,7 @@ class _FocusDemoState extends State<FocusDemo> {
|
||||
onKey: _handleKeyPress,
|
||||
autofocus: true,
|
||||
child: DefaultTextStyle(
|
||||
style: textTheme.headline4!,
|
||||
style: textTheme.headlineMedium!,
|
||||
child: Scaffold(
|
||||
appBar: AppBar(
|
||||
title: const Text('Focus Demo'),
|
||||
|
||||
@@ -29,7 +29,7 @@ class _HoverDemoState extends State<HoverDemo> {
|
||||
);
|
||||
|
||||
return DefaultTextStyle(
|
||||
style: textTheme.headline4!,
|
||||
style: textTheme.headlineMedium!,
|
||||
child: Scaffold(
|
||||
appBar: AppBar(
|
||||
title: const Text('Hover Demo'),
|
||||
|
||||
@@ -214,7 +214,7 @@ class _PointDemoState extends State<_PointDemo> {
|
||||
child: Text(
|
||||
'Tap the refresh button to run the animation. Drag the green '
|
||||
"and red points to change the animation's path.",
|
||||
style: Theme.of(context).textTheme.caption?.copyWith(fontSize: 16.0),
|
||||
style: Theme.of(context).textTheme.bodySmall?.copyWith(fontSize: 16.0),
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -382,7 +382,7 @@ class _RectangleDemoState extends State<_RectangleDemo> {
|
||||
child: Text(
|
||||
'Tap the refresh button to run the animation. Drag the rectangles '
|
||||
"to change the animation's path.",
|
||||
style: Theme.of(context).textTheme.caption!.copyWith(fontSize: 16.0),
|
||||
style: Theme.of(context).textTheme.bodySmall!.copyWith(fontSize: 16.0),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -66,12 +66,12 @@ class _HardwareKeyDemoState extends State<RawKeyboardDemo> {
|
||||
onTap: () {
|
||||
_focusNode.requestFocus();
|
||||
},
|
||||
child: Text('Tap to focus', style: textTheme.headline4),
|
||||
child: Text('Tap to focus', style: textTheme.headlineMedium),
|
||||
);
|
||||
}
|
||||
|
||||
if (_event == null) {
|
||||
return Text('Press a key', style: textTheme.headline4);
|
||||
return Text('Press a key', style: textTheme.headlineMedium);
|
||||
}
|
||||
|
||||
final RawKeyEventData? data = _event?.data;
|
||||
@@ -139,7 +139,7 @@ class _HardwareKeyDemoState extends State<RawKeyboardDemo> {
|
||||
}
|
||||
dataText.add(Text(pressed.join(' ')));
|
||||
return DefaultTextStyle(
|
||||
style: textTheme.subtitle1!,
|
||||
style: textTheme.titleMedium!,
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: dataText,
|
||||
|
||||
Reference in New Issue
Block a user