From 07ad5033480606a56e9bda112b8164bf5b2d89ac Mon Sep 17 00:00:00 2001 From: Vishesh Handa Date: Thu, 5 Dec 2019 17:22:31 +0100 Subject: [PATCH] AppDrawer: Go back to the main route without stacking The routing would be confusing otherwise --- lib/widgets/app_drawer.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/widgets/app_drawer.dart b/lib/widgets/app_drawer.dart index e00693c3..e34f7bdf 100644 --- a/lib/widgets/app_drawer.dart +++ b/lib/widgets/app_drawer.dart @@ -67,8 +67,8 @@ class AppDrawer extends StatelessWidget { if (m.settings.name == "/") { Navigator.pop(context); } else { - Navigator.pop(context); - Navigator.pushReplacementNamed(context, '/'); + Navigator.popUntil( + context, (route) => route.settings.name == '/'); } }, ),