From df64d1b303c40dccd295105ef02c4fa7abd76464 Mon Sep 17 00:00:00 2001 From: Per Classon Date: Wed, 8 Jul 2020 18:46:02 +0200 Subject: [PATCH] Remove shouldCapTextScaleForTitle from AppBarTheme (#61000) --- .../flutter/lib/src/material/app_bar.dart | 21 +++++------ .../lib/src/material/app_bar_theme.dart | 35 +------------------ 2 files changed, 10 insertions(+), 46 deletions(-) diff --git a/packages/flutter/lib/src/material/app_bar.dart b/packages/flutter/lib/src/material/app_bar.dart index c548f0b16f..3c3bd44252 100644 --- a/packages/flutter/lib/src/material/app_bar.dart +++ b/packages/flutter/lib/src/material/app_bar.dart @@ -584,19 +584,16 @@ class _AppBarState extends State { // sizes. To opt out, wrap the [title] widget in a [MediaQuery] widget // with [MediaQueryData.textScaleFactor] set to // `MediaQuery.textScaleFactorOf(context)`. - // ignore: deprecated_member_use_from_same_package - if (appBarTheme?.shouldCapTextScaleForTitle == true) { - final MediaQueryData mediaQueryData = MediaQuery.of(context); - title = MediaQuery( - data: mediaQueryData.copyWith( - textScaleFactor: math.min( - mediaQueryData.textScaleFactor, - _kMaxTitleTextScaleFactor, - ), + final MediaQueryData mediaQueryData = MediaQuery.of(context); + title = MediaQuery( + data: mediaQueryData.copyWith( + textScaleFactor: math.min( + mediaQueryData.textScaleFactor, + _kMaxTitleTextScaleFactor, ), - child: title, - ); - } + ), + child: title, + ); } Widget actions; diff --git a/packages/flutter/lib/src/material/app_bar_theme.dart b/packages/flutter/lib/src/material/app_bar_theme.dart index 5bb6f5ea2f..356bf47ab5 100644 --- a/packages/flutter/lib/src/material/app_bar_theme.dart +++ b/packages/flutter/lib/src/material/app_bar_theme.dart @@ -41,12 +41,6 @@ class AppBarTheme with Diagnosticable { this.actionsIconTheme, this.textTheme, 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]. @@ -89,19 +83,6 @@ class AppBarTheme with Diagnosticable { /// If null, the value is adapted to current [TargetPlatform]. 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 /// new values. AppBarTheme copyWith({ @@ -113,12 +94,6 @@ class AppBarTheme with Diagnosticable { IconThemeData iconTheme, TextTheme textTheme, 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( brightness: brightness ?? this.brightness, @@ -129,8 +104,6 @@ class AppBarTheme with Diagnosticable { actionsIconTheme: actionsIconTheme ?? this.actionsIconTheme, textTheme: textTheme ?? this.textTheme, centerTitle: centerTitle ?? this.centerTitle, - // ignore: deprecated_member_use_from_same_package - shouldCapTextScaleForTitle: shouldCapTextScaleForTitle ?? this.shouldCapTextScaleForTitle, ); } @@ -155,8 +128,6 @@ class AppBarTheme with Diagnosticable { actionsIconTheme: IconThemeData.lerp(a?.actionsIconTheme, b?.actionsIconTheme, t), textTheme: TextTheme.lerp(a?.textTheme, b?.textTheme, t), 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 { && other.iconTheme == iconTheme && other.actionsIconTheme == actionsIconTheme && other.textTheme == textTheme - && other.centerTitle == centerTitle - // ignore: deprecated_member_use_from_same_package - && other.shouldCapTextScaleForTitle == shouldCapTextScaleForTitle; + && other.centerTitle == centerTitle; } @override @@ -204,7 +173,5 @@ class AppBarTheme with Diagnosticable { properties.add(DiagnosticsProperty('actionsIconTheme', actionsIconTheme, defaultValue: null)); properties.add(DiagnosticsProperty('textTheme', textTheme, defaultValue: null)); properties.add(DiagnosticsProperty('centerTitle', centerTitle, defaultValue: null)); - // ignore: deprecated_member_use_from_same_package - properties.add(DiagnosticsProperty('shouldCapTextScaleForTitle', shouldCapTextScaleForTitle, defaultValue: null)); } }