-
Notifications
You must be signed in to change notification settings - Fork 29.8k
Closed
flutter/packages
#5497Labels
P3Issues that are less important to the Flutter projectIssues that are less important to the Flutter projectp: go_routerThe go_router packageThe go_router packagepackageflutter/packages repository. See also p: labels.flutter/packages repository. See also p: labels.
Description
Currently, the builder doesn't have access to the InheritedGoRouter:
testWidgets('builder can access GoRouter', (WidgetTester tester) async {
late final GoRouter buildContextRouter;
final GoRouter router = GoRouter(
initialLocation: '/',
routes: <GoRoute>[
GoRoute(
path: '/',
builder: (BuildContext context, __) {
buildContextRouter = GoRouter.of(context);
return const DummyScreen();
},
)
],
);
await tester.pumpWidget(
MaterialApp.router(
routeInformationProvider: router.routeInformationProvider,
routeInformationParser: router.routeInformationParser,
routerDelegate: router.routerDelegate),
);
expect(buildContextRouter, isNotNull);
expect(buildContextRouter, equals(router));
});Metadata
Metadata
Assignees
Labels
P3Issues that are less important to the Flutter projectIssues that are less important to the Flutter projectp: go_routerThe go_router packageThe go_router packagepackageflutter/packages repository. See also p: labels.flutter/packages repository. See also p: labels.