From cf3077ea981c743ddc770757f1d2a3212d7493d1 Mon Sep 17 00:00:00 2001 From: Hixie Date: Mon, 7 Dec 2015 14:54:03 -0800 Subject: [PATCH] Navigator.popUntil This was already supported in the underlying classes but somehow not exposed by Navigator itself. --- packages/flutter/lib/src/widgets/navigator.dart | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/flutter/lib/src/widgets/navigator.dart b/packages/flutter/lib/src/widgets/navigator.dart index e2994f8baf..b774279608 100644 --- a/packages/flutter/lib/src/widgets/navigator.dart +++ b/packages/flutter/lib/src/widgets/navigator.dart @@ -137,6 +137,12 @@ class Navigator extends StatefulComponent { }); return returnValue; } + + static void popUntil(BuildContext context, Route targetRoute) { + openTransaction(context, (NavigatorTransaction transaction) { + transaction.popUntil(targetRoute); + }); + } static bool canPop(BuildContext context) { NavigatorState navigator = context.ancestorStateOfType(NavigatorState);