Skip to content

Commit b35f2cd

Browse files
authored
Enable shouldCapTextScaleForTitle by default (flutter#60684)
1 parent 0bffc8a commit b35f2cd

File tree

2 files changed

+18
-27
lines changed

2 files changed

+18
-27
lines changed

packages/flutter/lib/src/material/app_bar_theme.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ class AppBarTheme with Diagnosticable {
4646
'This feature was deprecated after v1.19.0.'
4747
)
4848
// ignore: deprecated_member_use_from_same_package
49-
this.shouldCapTextScaleForTitle = false,
49+
this.shouldCapTextScaleForTitle = true,
5050
});
5151

5252
/// Default value for [AppBar.brightness].

packages/flutter/test/material/app_bar_test.dart

Lines changed: 17 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1835,21 +1835,12 @@ void main() {
18351835
return MaterialApp(
18361836
home: Builder(
18371837
builder: (BuildContext context) {
1838-
final ThemeData themeData = Theme.of(context);
1839-
return Theme(
1840-
data: themeData.copyWith(
1841-
appBarTheme: themeData.appBarTheme.copyWith(
1842-
// ignore: deprecated_member_use_from_same_package
1843-
shouldCapTextScaleForTitle: true,
1844-
),
1845-
),
1846-
child: MediaQuery(
1847-
data: MediaQuery.of(context).copyWith(textScaleFactor: textScaleFactor),
1848-
child: Scaffold(
1849-
appBar: AppBar(
1850-
centerTitle: false,
1851-
title: const Text('Jumbo', style: TextStyle(fontSize: 18)),
1852-
),
1838+
return MediaQuery(
1839+
data: MediaQuery.of(context).copyWith(textScaleFactor: textScaleFactor),
1840+
child: Scaffold(
1841+
appBar: AppBar(
1842+
centerTitle: false,
1843+
title: const Text('Jumbo', style: TextStyle(fontSize: 18)),
18531844
),
18541845
),
18551846
);
@@ -1884,18 +1875,18 @@ void main() {
18841875
builder: (BuildContext context) {
18851876
return Directionality(
18861877
textDirection: textDirection,
1887-
child: MediaQuery(
1888-
data: MediaQuery.of(context).copyWith(textScaleFactor: textScaleFactor),
1889-
child: Builder(
1890-
builder: (BuildContext context) {
1891-
return Scaffold(
1892-
appBar: AppBar(
1893-
centerTitle: centerTitle,
1894-
title: const Text('Jumbo'),
1878+
child: Builder(
1879+
builder: (BuildContext context) {
1880+
return Scaffold(
1881+
appBar: AppBar(
1882+
centerTitle: centerTitle,
1883+
title: MediaQuery(
1884+
data: MediaQuery.of(context).copyWith(textScaleFactor: textScaleFactor),
1885+
child: const Text('Jumbo'),
18951886
),
1896-
);
1897-
},
1898-
),
1887+
),
1888+
);
1889+
},
18991890
),
19001891
);
19011892
},

0 commit comments

Comments
 (0)