@@ -154,7 +154,7 @@ class GoRouterDelegate extends RouterDelegate<RouteMatchList>
154
154
}
155
155
156
156
/// 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
158
158
// synchronously if possible.
159
159
@override
160
160
Future <void > setNewRoutePath (RouteMatchList configuration) {
@@ -179,7 +179,6 @@ class GoRouterDelegate extends RouterDelegate<RouteMatchList>
179
179
}
180
180
}
181
181
if (indexOfFirstDiff < currentConfiguration.matches.length) {
182
- // Appends onExit future to the result future and return early if
183
182
final List <GoRoute > exitingGoRoutes = currentConfiguration.matches
184
183
.sublist (indexOfFirstDiff)
185
184
.map <RouteBase >((RouteMatch match) => match.route)
@@ -199,6 +198,10 @@ class GoRouterDelegate extends RouterDelegate<RouteMatchList>
199
198
return _setCurrentConfiguration (configuration);
200
199
}
201
200
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.
202
205
static Future <bool > _callOnExitStartsAt (int index,
203
206
{required BuildContext navigatorContext, required List <GoRoute > routes}) {
204
207
if (index < 0 ) {
@@ -209,6 +212,7 @@ class GoRouterDelegate extends RouterDelegate<RouteMatchList>
209
212
return _callOnExitStartsAt (index - 1 ,
210
213
navigatorContext: navigatorContext, routes: routes);
211
214
}
215
+
212
216
Future <bool > handleOnExitResult (bool exit) {
213
217
if (exit) {
214
218
return _callOnExitStartsAt (index - 1 ,
0 commit comments