Unverified Commit c8569b6e authored by Qun Cheng's avatar Qun Cheng Committed by GitHub

Revert "Fixed leading button size on app bar (#110043)" (#110103)

This reverts commit 7e33cd5e.
parent c8652075
...@@ -998,16 +998,11 @@ class _AppBarState extends State<AppBar> { ...@@ -998,16 +998,11 @@ class _AppBarState extends State<AppBar> {
} }
} }
if (leading != null) { if (leading != null) {
leading = theme.useMaterial3 leading = Container(
? Container( alignment: Alignment.center,
alignment: Alignment.center, constraints: BoxConstraints.tightFor(width: widget.leadingWidth ?? _kLeadingWidth),
constraints: BoxConstraints.tightFor(width: widget.leadingWidth ?? _kLeadingWidth), child: leading,
child: leading, );
)
: ConstrainedBox(
constraints: BoxConstraints.tightFor(width: widget.leadingWidth ?? _kLeadingWidth),
child: leading,
);
} }
Widget? title = widget.title; Widget? title = widget.title;
......
...@@ -694,11 +694,9 @@ void main() { ...@@ -694,11 +694,9 @@ void main() {
}); });
testWidgets('leading button extends to edge and is square', (WidgetTester tester) async { testWidgets('leading button extends to edge and is square', (WidgetTester tester) async {
final ThemeData themeData = ThemeData(platform: TargetPlatform.android);
final bool material3 = themeData.useMaterial3;
await tester.pumpWidget( await tester.pumpWidget(
MaterialApp( MaterialApp(
theme: themeData, theme: ThemeData(platform: TargetPlatform.android),
home: Scaffold( home: Scaffold(
appBar: AppBar( appBar: AppBar(
title: const Text('X'), title: const Text('X'),
...@@ -708,9 +706,9 @@ void main() { ...@@ -708,9 +706,9 @@ void main() {
), ),
); );
final Finder hamburger = find.byType(IconButton); final Finder hamburger = find.byTooltip('Open navigation menu');
expect(tester.getTopLeft(hamburger), material3 ? const Offset(4.0, 4.0) : Offset.zero); expect(tester.getTopLeft(hamburger), const Offset(4.0, 4.0));
expect(tester.getSize(hamburger), material3 ? const Size(48.0, 48.0) : const Size(56.0, 56.0)); expect(tester.getSize(hamburger), const Size(48.0, 48.0));
}); });
testWidgets('test action is 4dp from edge and 48dp min', (WidgetTester tester) async { testWidgets('test action is 4dp from edge and 48dp min', (WidgetTester tester) async {
......
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