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

Enable shouldCapTextScaleForTitle by default (#60684)

parent 0bffc8a3
...@@ -46,7 +46,7 @@ class AppBarTheme with Diagnosticable { ...@@ -46,7 +46,7 @@ class AppBarTheme with Diagnosticable {
'This feature was deprecated after v1.19.0.' 'This feature was deprecated after v1.19.0.'
) )
// ignore: deprecated_member_use_from_same_package // ignore: deprecated_member_use_from_same_package
this.shouldCapTextScaleForTitle = false, this.shouldCapTextScaleForTitle = true,
}); });
/// Default value for [AppBar.brightness]. /// Default value for [AppBar.brightness].
......
...@@ -1835,15 +1835,7 @@ void main() { ...@@ -1835,15 +1835,7 @@ void main() {
return MaterialApp( return MaterialApp(
home: Builder( home: Builder(
builder: (BuildContext context) { builder: (BuildContext context) {
final ThemeData themeData = Theme.of(context); return MediaQuery(
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), data: MediaQuery.of(context).copyWith(textScaleFactor: textScaleFactor),
child: Scaffold( child: Scaffold(
appBar: AppBar( appBar: AppBar(
...@@ -1851,7 +1843,6 @@ void main() { ...@@ -1851,7 +1843,6 @@ void main() {
title: const Text('Jumbo', style: TextStyle(fontSize: 18)), title: const Text('Jumbo', style: TextStyle(fontSize: 18)),
), ),
), ),
),
); );
}, },
), ),
...@@ -1884,19 +1875,19 @@ void main() { ...@@ -1884,19 +1875,19 @@ void main() {
builder: (BuildContext context) { builder: (BuildContext context) {
return Directionality( return Directionality(
textDirection: textDirection, textDirection: textDirection,
child: MediaQuery(
data: MediaQuery.of(context).copyWith(textScaleFactor: textScaleFactor),
child: Builder( child: Builder(
builder: (BuildContext context) { builder: (BuildContext context) {
return Scaffold( return Scaffold(
appBar: AppBar( appBar: AppBar(
centerTitle: centerTitle, centerTitle: centerTitle,
title: const Text('Jumbo'), title: MediaQuery(
data: MediaQuery.of(context).copyWith(textScaleFactor: textScaleFactor),
child: const Text('Jumbo'),
),
), ),
); );
}, },
), ),
),
); );
}, },
), ),
......
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