Skip to content

Commit 47f43a4

Browse files
committed
update
1 parent 5e1236e commit 47f43a4

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

packages/go_router/lib/src/delegate.dart

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ class GoRouterDelegate extends RouterDelegate<RouteMatchList>
154154
}
155155

156156
/// For use by the Router architecture as part of the RouterDelegate.
157-
// This class avoid using async to make sure the route is processed
157+
// This class avoids using async to make sure the route is processed
158158
// synchronously if possible.
159159
@override
160160
Future<void> setNewRoutePath(RouteMatchList configuration) {
@@ -179,7 +179,6 @@ class GoRouterDelegate extends RouterDelegate<RouteMatchList>
179179
}
180180
}
181181
if (indexOfFirstDiff < currentConfiguration.matches.length) {
182-
// Appends onExit future to the result future and return early if
183182
final List<GoRoute> exitingGoRoutes = currentConfiguration.matches
184183
.sublist(indexOfFirstDiff)
185184
.map<RouteBase>((RouteMatch match) => match.route)
@@ -199,6 +198,10 @@ class GoRouterDelegate extends RouterDelegate<RouteMatchList>
199198
return _setCurrentConfiguration(configuration);
200199
}
201200

201+
/// Calls [GoRoute.onExit] starting from the index
202+
///
203+
/// The returned future resolves to true if all routes below the index all
204+
/// return true. Otherwise, the returned future resolves to false.
202205
static Future<bool> _callOnExitStartsAt(int index,
203206
{required BuildContext navigatorContext, required List<GoRoute> routes}) {
204207
if (index < 0) {
@@ -209,6 +212,7 @@ class GoRouterDelegate extends RouterDelegate<RouteMatchList>
209212
return _callOnExitStartsAt(index - 1,
210213
navigatorContext: navigatorContext, routes: routes);
211214
}
215+
212216
Future<bool> handleOnExitResult(bool exit) {
213217
if (exit) {
214218
return _callOnExitStartsAt(index - 1,

0 commit comments

Comments
 (0)