Unverified Commit df64d1b3 authored by Per Classon's avatar Per Classon Committed by GitHub

Remove shouldCapTextScaleForTitle from AppBarTheme (#61000)

parent f567a0cc
...@@ -584,8 +584,6 @@ class _AppBarState extends State<AppBar> { ...@@ -584,8 +584,6 @@ class _AppBarState extends State<AppBar> {
// sizes. To opt out, wrap the [title] widget in a [MediaQuery] widget // sizes. To opt out, wrap the [title] widget in a [MediaQuery] widget
// with [MediaQueryData.textScaleFactor] set to // with [MediaQueryData.textScaleFactor] set to
// `MediaQuery.textScaleFactorOf(context)`. // `MediaQuery.textScaleFactorOf(context)`.
// ignore: deprecated_member_use_from_same_package
if (appBarTheme?.shouldCapTextScaleForTitle == true) {
final MediaQueryData mediaQueryData = MediaQuery.of(context); final MediaQueryData mediaQueryData = MediaQuery.of(context);
title = MediaQuery( title = MediaQuery(
data: mediaQueryData.copyWith( data: mediaQueryData.copyWith(
...@@ -597,7 +595,6 @@ class _AppBarState extends State<AppBar> { ...@@ -597,7 +595,6 @@ class _AppBarState extends State<AppBar> {
child: title, child: title,
); );
} }
}
Widget actions; Widget actions;
if (widget.actions != null && widget.actions.isNotEmpty) { if (widget.actions != null && widget.actions.isNotEmpty) {
......
...@@ -41,12 +41,6 @@ class AppBarTheme with Diagnosticable { ...@@ -41,12 +41,6 @@ class AppBarTheme with Diagnosticable {
this.actionsIconTheme, this.actionsIconTheme,
this.textTheme, this.textTheme,
this.centerTitle, this.centerTitle,
@Deprecated(
'Deprecated property to cap text scaling for title. '
'This feature was deprecated after v1.19.0.'
)
// ignore: deprecated_member_use_from_same_package
this.shouldCapTextScaleForTitle = true,
}); });
/// Default value for [AppBar.brightness]. /// Default value for [AppBar.brightness].
...@@ -89,19 +83,6 @@ class AppBarTheme with Diagnosticable { ...@@ -89,19 +83,6 @@ class AppBarTheme with Diagnosticable {
/// If null, the value is adapted to current [TargetPlatform]. /// If null, the value is adapted to current [TargetPlatform].
final bool centerTitle; final bool centerTitle;
/// Cap text scale to a maximum for [AppBar.title].
///
/// This flag is deprecated and caps the text scaling to a maximum for
/// [AppBar.title], to keep the visual hierarchy in an app with large font
/// sizes. It exists to provide backwards compatibility to ease migrations,
/// and will eventually be removed as the maximum text scale will be enabled
/// by default.
@Deprecated(
'Deprecated property to cap text scaling for title. '
'This feature was deprecated after v1.19.0.'
)
final bool shouldCapTextScaleForTitle;
/// Creates a copy of this object with the given fields replaced with the /// Creates a copy of this object with the given fields replaced with the
/// new values. /// new values.
AppBarTheme copyWith({ AppBarTheme copyWith({
...@@ -113,12 +94,6 @@ class AppBarTheme with Diagnosticable { ...@@ -113,12 +94,6 @@ class AppBarTheme with Diagnosticable {
IconThemeData iconTheme, IconThemeData iconTheme,
TextTheme textTheme, TextTheme textTheme,
bool centerTitle, bool centerTitle,
@Deprecated(
'Deprecated property to cap text scaling for title. '
'This feature was deprecated after v1.19.0.'
)
// ignore: deprecated_member_use_from_same_package
bool shouldCapTextScaleForTitle,
}) { }) {
return AppBarTheme( return AppBarTheme(
brightness: brightness ?? this.brightness, brightness: brightness ?? this.brightness,
...@@ -129,8 +104,6 @@ class AppBarTheme with Diagnosticable { ...@@ -129,8 +104,6 @@ class AppBarTheme with Diagnosticable {
actionsIconTheme: actionsIconTheme ?? this.actionsIconTheme, actionsIconTheme: actionsIconTheme ?? this.actionsIconTheme,
textTheme: textTheme ?? this.textTheme, textTheme: textTheme ?? this.textTheme,
centerTitle: centerTitle ?? this.centerTitle, centerTitle: centerTitle ?? this.centerTitle,
// ignore: deprecated_member_use_from_same_package
shouldCapTextScaleForTitle: shouldCapTextScaleForTitle ?? this.shouldCapTextScaleForTitle,
); );
} }
...@@ -155,8 +128,6 @@ class AppBarTheme with Diagnosticable { ...@@ -155,8 +128,6 @@ class AppBarTheme with Diagnosticable {
actionsIconTheme: IconThemeData.lerp(a?.actionsIconTheme, b?.actionsIconTheme, t), actionsIconTheme: IconThemeData.lerp(a?.actionsIconTheme, b?.actionsIconTheme, t),
textTheme: TextTheme.lerp(a?.textTheme, b?.textTheme, t), textTheme: TextTheme.lerp(a?.textTheme, b?.textTheme, t),
centerTitle: t < 0.5 ? a?.centerTitle : b?.centerTitle, centerTitle: t < 0.5 ? a?.centerTitle : b?.centerTitle,
// ignore: deprecated_member_use_from_same_package
shouldCapTextScaleForTitle: a?.shouldCapTextScaleForTitle == true || b?.shouldCapTextScaleForTitle == true,
); );
} }
...@@ -188,9 +159,7 @@ class AppBarTheme with Diagnosticable { ...@@ -188,9 +159,7 @@ class AppBarTheme with Diagnosticable {
&& other.iconTheme == iconTheme && other.iconTheme == iconTheme
&& other.actionsIconTheme == actionsIconTheme && other.actionsIconTheme == actionsIconTheme
&& other.textTheme == textTheme && other.textTheme == textTheme
&& other.centerTitle == centerTitle && other.centerTitle == centerTitle;
// ignore: deprecated_member_use_from_same_package
&& other.shouldCapTextScaleForTitle == shouldCapTextScaleForTitle;
} }
@override @override
...@@ -204,7 +173,5 @@ class AppBarTheme with Diagnosticable { ...@@ -204,7 +173,5 @@ class AppBarTheme with Diagnosticable {
properties.add(DiagnosticsProperty<IconThemeData>('actionsIconTheme', actionsIconTheme, defaultValue: null)); properties.add(DiagnosticsProperty<IconThemeData>('actionsIconTheme', actionsIconTheme, defaultValue: null));
properties.add(DiagnosticsProperty<TextTheme>('textTheme', textTheme, defaultValue: null)); properties.add(DiagnosticsProperty<TextTheme>('textTheme', textTheme, defaultValue: null));
properties.add(DiagnosticsProperty<bool>('centerTitle', centerTitle, defaultValue: null)); properties.add(DiagnosticsProperty<bool>('centerTitle', centerTitle, defaultValue: null));
// ignore: deprecated_member_use_from_same_package
properties.add(DiagnosticsProperty<bool>('shouldCapTextScaleForTitle', shouldCapTextScaleForTitle, defaultValue: null));
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment