Deprecate 2018 text theme parameters (#109817)
This commit is contained in:
@@ -28,7 +28,7 @@ class MyStatelessWidget extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final ThemeData theme = Theme.of(context);
|
||||
final TextStyle textStyle = theme.textTheme.bodyText2!;
|
||||
final TextStyle textStyle = theme.textTheme.bodyMedium!;
|
||||
final List<Widget> aboutBoxChildren = <Widget>[
|
||||
const SizedBox(height: 24),
|
||||
RichText(
|
||||
|
||||
@@ -56,7 +56,7 @@ class MyStatelessWidget extends StatelessWidget {
|
||||
alignment: AlignmentDirectional.centerStart,
|
||||
child: Text(
|
||||
'Subheader',
|
||||
style: Theme.of(context).textTheme.caption,
|
||||
style: Theme.of(context).textTheme.bodySmall,
|
||||
textAlign: TextAlign.start,
|
||||
),
|
||||
),
|
||||
|
||||
@@ -33,12 +33,12 @@ class RootPage extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final TextStyle headline5 = Theme.of(context).textTheme.headline5!;
|
||||
final TextStyle headlineSmall = Theme.of(context).textTheme.headlineSmall!;
|
||||
final ButtonStyle buttonStyle = ElevatedButton.styleFrom(
|
||||
backgroundColor: destination.color,
|
||||
visualDensity: VisualDensity.comfortable,
|
||||
padding: const EdgeInsets.symmetric(vertical: 12, horizontal: 16),
|
||||
textStyle: headline5,
|
||||
textStyle: headlineSmall,
|
||||
);
|
||||
|
||||
return Scaffold(
|
||||
@@ -97,7 +97,7 @@ class RootPage extends StatelessWidget {
|
||||
child: Text(
|
||||
'${destination.title} BottomSheet\n'
|
||||
'Tap the back button to dismiss',
|
||||
style: headline5,
|
||||
style: headlineSmall,
|
||||
softWrap: true,
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
@@ -127,7 +127,7 @@ class ListPage extends StatelessWidget {
|
||||
final ButtonStyle buttonStyle = OutlinedButton.styleFrom(
|
||||
foregroundColor: destination.color,
|
||||
fixedSize: const Size.fromHeight(128),
|
||||
textStyle: Theme.of(context).textTheme.headline5,
|
||||
textStyle: Theme.of(context).textTheme.headlineSmall,
|
||||
);
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
@@ -198,7 +198,7 @@ class _TextPageState extends State<TextPage> {
|
||||
alignment: Alignment.center,
|
||||
child: TextField(
|
||||
controller: textController,
|
||||
style: theme.primaryTextTheme.headline4?.copyWith(
|
||||
style: theme.primaryTextTheme.headlineMedium?.copyWith(
|
||||
color: widget.destination.color,
|
||||
),
|
||||
decoration: InputDecoration(
|
||||
|
||||
@@ -62,7 +62,7 @@ class _MyStatefulWidgetState extends State<MyStatefulWidget>
|
||||
children: <Widget>[
|
||||
Text(
|
||||
'Circular progress indicator with a fixed color',
|
||||
style: Theme.of(context).textTheme.headline6,
|
||||
style: Theme.of(context).textTheme.titleLarge,
|
||||
),
|
||||
CircularProgressIndicator(
|
||||
value: controller.value,
|
||||
|
||||
@@ -46,7 +46,7 @@ class _MyAppState extends State<MyApp> {
|
||||
),
|
||||
Text(
|
||||
'$_counter',
|
||||
style: Theme.of(context).textTheme.headline4,
|
||||
style: Theme.of(context).textTheme.headlineMedium,
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
@@ -56,7 +56,7 @@ class MyStatelessWidget extends StatelessWidget {
|
||||
return Center(
|
||||
child: Text(
|
||||
'${tab.text!} Tab',
|
||||
style: Theme.of(context).textTheme.headline5,
|
||||
style: Theme.of(context).textTheme.headlineSmall,
|
||||
),
|
||||
);
|
||||
}).toList(),
|
||||
|
||||
@@ -68,7 +68,7 @@ class _ToggleButtonsSampleState extends State<ToggleButtonsSample> {
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: <Widget>[
|
||||
// ToggleButtons with a single selection.
|
||||
Text('Single-select', style: theme.textTheme.subtitle2),
|
||||
Text('Single-select', style: theme.textTheme.titleSmall),
|
||||
const SizedBox(height: 5),
|
||||
ToggleButtons(
|
||||
direction: vertical ? Axis.vertical : Axis.horizontal,
|
||||
@@ -94,7 +94,7 @@ class _ToggleButtonsSampleState extends State<ToggleButtonsSample> {
|
||||
),
|
||||
const SizedBox(height: 20),
|
||||
// ToggleButtons with a multiple selection.
|
||||
Text('Multi-select', style: theme.textTheme.subtitle2),
|
||||
Text('Multi-select', style: theme.textTheme.titleSmall),
|
||||
const SizedBox(height: 5),
|
||||
ToggleButtons(
|
||||
direction: vertical ? Axis.vertical : Axis.horizontal,
|
||||
@@ -119,7 +119,7 @@ class _ToggleButtonsSampleState extends State<ToggleButtonsSample> {
|
||||
),
|
||||
const SizedBox(height: 20),
|
||||
// ToggleButtons with icons only.
|
||||
Text('Icon-only', style: theme.textTheme.subtitle2),
|
||||
Text('Icon-only', style: theme.textTheme.titleSmall),
|
||||
const SizedBox(height: 5),
|
||||
ToggleButtons(
|
||||
direction: vertical ? Axis.vertical : Axis.horizontal,
|
||||
|
||||
Reference in New Issue
Block a user