router property Null safety
final
Implementation
final router = GoRouter(
initialLocation: Routes.home.routePath,
debugLogDiagnostics: true,
errorPageBuilder: (context, state) => MaterialPage<void>(
key: state.pageKey,
child: ErrorPageView(error: state.error),
),
routes: [
GoRoute(
path: Routes.home.routePath,
name: Routes.home.routeName,
builder: (context, _) => const GalleryView(),
routes: [
GoRoute(
path: Routes.imageCarousel.routePath,
name: Routes.imageCarousel.routeName,
builder: (context, state) => ImageCarouselView(
imageCarouselViewArguments: state.extra as ImageCarouselViewArguments,
),
),
],
),
],
);