From b35f2cd4caaf4898b2818342cfa4be9fa76a5de2 Mon Sep 17 00:00:00 2001 From: Per Classon Date: Wed, 1 Jul 2020 19:53:01 +0200 Subject: [PATCH] Enable shouldCapTextScaleForTitle by default (#60684) --- .../lib/src/material/app_bar_theme.dart | 2 +- .../flutter/test/material/app_bar_test.dart | 43 ++++++++----------- 2 files changed, 18 insertions(+), 27 deletions(-) diff --git a/packages/flutter/lib/src/material/app_bar_theme.dart b/packages/flutter/lib/src/material/app_bar_theme.dart index 149e9f668be..5bb6f5ea2f8 100644 --- a/packages/flutter/lib/src/material/app_bar_theme.dart +++ b/packages/flutter/lib/src/material/app_bar_theme.dart @@ -46,7 +46,7 @@ class AppBarTheme with Diagnosticable { 'This feature was deprecated after v1.19.0.' ) // ignore: deprecated_member_use_from_same_package - this.shouldCapTextScaleForTitle = false, + this.shouldCapTextScaleForTitle = true, }); /// Default value for [AppBar.brightness]. diff --git a/packages/flutter/test/material/app_bar_test.dart b/packages/flutter/test/material/app_bar_test.dart index f153a6a1858..944b23c1060 100644 --- a/packages/flutter/test/material/app_bar_test.dart +++ b/packages/flutter/test/material/app_bar_test.dart @@ -1835,21 +1835,12 @@ void main() { return MaterialApp( home: Builder( builder: (BuildContext context) { - final ThemeData themeData = Theme.of(context); - return Theme( - data: themeData.copyWith( - appBarTheme: themeData.appBarTheme.copyWith( - // ignore: deprecated_member_use_from_same_package - shouldCapTextScaleForTitle: true, - ), - ), - child: MediaQuery( - data: MediaQuery.of(context).copyWith(textScaleFactor: textScaleFactor), - child: Scaffold( - appBar: AppBar( - centerTitle: false, - title: const Text('Jumbo', style: TextStyle(fontSize: 18)), - ), + return MediaQuery( + data: MediaQuery.of(context).copyWith(textScaleFactor: textScaleFactor), + child: Scaffold( + appBar: AppBar( + centerTitle: false, + title: const Text('Jumbo', style: TextStyle(fontSize: 18)), ), ), ); @@ -1884,18 +1875,18 @@ void main() { builder: (BuildContext context) { return Directionality( textDirection: textDirection, - child: MediaQuery( - data: MediaQuery.of(context).copyWith(textScaleFactor: textScaleFactor), - child: Builder( - builder: (BuildContext context) { - return Scaffold( - appBar: AppBar( - centerTitle: centerTitle, - title: const Text('Jumbo'), + child: Builder( + builder: (BuildContext context) { + return Scaffold( + appBar: AppBar( + centerTitle: centerTitle, + title: MediaQuery( + data: MediaQuery.of(context).copyWith(textScaleFactor: textScaleFactor), + child: const Text('Jumbo'), ), - ); - }, - ), + ), + ); + }, ), ); },