mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
Remove back button when using end drawer (#63272)
This commit is contained in:
parent
37b03ec2c2
commit
dfd0c6270f
@ -555,7 +555,7 @@ class _AppBarState extends State<AppBar> {
|
||||
tooltip: MaterialLocalizations.of(context).openAppDrawerTooltip,
|
||||
);
|
||||
} else {
|
||||
if (canPop)
|
||||
if (!hasEndDrawer && canPop)
|
||||
leading = useCloseButton ? const CloseButton() : const BackButton();
|
||||
}
|
||||
}
|
||||
|
||||
@ -2194,4 +2194,21 @@ void main() {
|
||||
// By default toolbarHeight is 56.0.
|
||||
expect(tester.getRect(find.byKey(key)), const Rect.fromLTRB(0, 0, 100, 56));
|
||||
});
|
||||
|
||||
testWidgets("AppBar with EndDrawer doesn't have leading", (WidgetTester tester) async {
|
||||
await tester.pumpWidget(MaterialApp(
|
||||
home: Scaffold(
|
||||
appBar: AppBar(),
|
||||
endDrawer: const Drawer(),
|
||||
),
|
||||
));
|
||||
|
||||
final Finder endDrawerFinder = find.byTooltip('Open navigation menu');
|
||||
await tester.tap(endDrawerFinder);
|
||||
await tester.pump();
|
||||
|
||||
final Finder appBarFinder = find.byType(NavigationToolbar);
|
||||
NavigationToolbar getAppBarWidget(Finder finder) => tester.widget<NavigationToolbar>(finder);
|
||||
expect(getAppBarWidget(appBarFinder).leading, null);
|
||||
});
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user