Skip to content

Upgrading go_router 17 to 18

Breaking17.5.0 → 18.1.2Platform1New2Changed1Fixed6Other1

Fetching 6 releases from GitHub…5 / 6
BreakingUpgrade verdict

A platform requirement change.

  • You need at least Flutter 3.44 and Dart 3.12 to use this version.
1 item needs code or config changes

go_router publishes an official migration guide for version 18. It covers more than the release notes do.

Migrating to go_router 18 ↗

Dart SDK requirement changed in 18.0.0: ^3.10.0 → ^3.12.0.

Flutter requirement changed in 18.0.0: >=3.38.0 → >=3.44.0.

Platform1
Updates minimum supported SDK version to Flutter 3.44/Dart 3.12.

Generated by DepDelta from published Dart source. Not mixed with prose notes.

  • changed: ctor GoRouteInformationProvider({ required String initialLocation, required Object? initialExtra, Listenable? refreshListenable, bool routerNeglect = …, }) → ctor GoRouteInformationProvider({ required String initialLocation, required Object? initialExtra, this._refreshListenable, this._routerNeglect = …, })
  • changed: ctor GoRouter.routingConfig({ required ValueListenable<RoutingConfig> routingConfig, Codec<Object?, Object?>? extraCodec, GoExceptionHandler? onException, GoRouterPageBuilder? errorPageBuilder, GoRouterWidgetBuilder? errorBuilder, Listenable? refreshListenable, bool routerNeglect = …, String? initialLocation, this.overridePlatformDefaultLocation = …, Object? initialExtra, this.observers, bool deb… → ctor GoRouter.routingConfig({ required this._routingConfig, Codec<Object?, Object?>? extraCodec, GoExceptionHandler? onException, GoRouterPageBuilder? errorPageBuilder, GoRouterWidgetBuilder? errorBuilder, Listenable? refreshListenable, bool routerNeglect = …, String? initialLocation, this.overridePlatformDefaultLocation = …, Object? initialExtra, this.observers, bool debugLogDiagnostics = …, Glo…
  • changed: ctor ShellRoute({ super.redirect, this.builder, this.pageBuilder, super.notifyRootObserver, this.observers, super.metadata, required super.routes, super.parentNavigatorKey, GlobalKey<NavigatorState>? navigatorKey, this.restorationScopeId, }) → ctor ShellRoute({ super.redirect, this.builder, this.pageBuilder, super.notifyRootObserver, this.observers, super.metadata, required super.routes, super.parentNavigatorKey, GlobalKey<NavigatorState>? navigatorKey, this.restorationScopeId, this.clipBehavior = …, })
  • changed: ctor StatefulNavigationShell({ required this.shellRouteContext, required GoRouter router, required this.containerBuilder, }) → ctor StatefulNavigationShell({ required this.shellRouteContext, required this._router, required this.containerBuilder, })
  • changed: ctor StatefulShellBranch({ required this.routes, GlobalKey<NavigatorState>? navigatorKey, this.initialLocation, this.restorationScopeId, this.observers, this.preload = …, }) → ctor StatefulShellBranch({ required this.routes, GlobalKey<NavigatorState>? navigatorKey, this.initialLocation, this.restorationScopeId, this.observers, this.preload = …, this.clipBehavior = …, })
  • changed: method ShellRouteMatch.copyWith({required List<RouteMatchBase>? matches}): ShellRouteMatch → method ShellRouteMatch.copyWith({ required List<RouteMatchBase>? matches, ValueKey<String>? pageKey, GlobalKey<NavigatorState>? navigatorKey, }): ShellRouteMatch
  • changed: static method ShellRouteData.$route<T extends ShellRouteData>({ required T Function(GoRouterState) factory, GlobalKey<NavigatorState>? navigatorKey, GlobalKey<NavigatorState>? parentNavigatorKey, List<RouteBase> routes = …, bool notifyRootObserver = …, List<NavigatorObserver>? observers, String? restorationScopeId, }): ShellRoute → static method ShellRouteData.$route<T extends ShellRouteData>({ required T Function(GoRouterState) factory, GlobalKey<NavigatorState>? navigatorKey, GlobalKey<NavigatorState>? parentNavigatorKey, List<RouteBase> routes = …, bool notifyRootObserver = …, List<NavigatorObserver>? observers, String? restorationScopeId, Clip clipBehavior = …, }): ShellRoute
  • changed: static method StatefulShellBranchData.$branch<T extends StatefulShellBranchData>({ GlobalKey<NavigatorState>? navigatorKey, List<RouteBase> routes = …, List<NavigatorObserver>? observers, String? initialLocation, String? restorationScopeId, bool preload = …, }): StatefulShellBranch → static method StatefulShellBranchData.$branch<T extends StatefulShellBranchData>({ GlobalKey<NavigatorState>? navigatorKey, List<RouteBase> routes = …, List<NavigatorObserver>? observers, String? initialLocation, String? restorationScopeId, bool preload = …, Clip clipBehavior = …, }): StatefulShellBranch
  • added: field ShellRoute.clipBehavior: final Clip
  • added: field StatefulShellBranch.clipBehavior: final Clip
  • added: get ShellRoute.pageIdentity: Object
  • added: get ShellRouteBase.pageIdentity: Object
  • added: get StatefulShellRoute.pageIdentity: Object