[go_router] Bumps example go_router version and migrate example code (#4469)
unblock any go_router or go_router_builder ci
diff --git a/packages/go_router_builder/CHANGELOG.md b/packages/go_router_builder/CHANGELOG.md
index 5d0d913..7e474dd 100644
--- a/packages/go_router_builder/CHANGELOG.md
+++ b/packages/go_router_builder/CHANGELOG.md
@@ -1,3 +1,7 @@
+## 2.2.2
+
+* Bumps example go_router version and migrate example code.
+
## 2.2.1
* Cleans up go_router_builder code.
diff --git a/packages/go_router_builder/example/lib/all_types.dart b/packages/go_router_builder/example/lib/all_types.dart
index 165523b..e5506d5 100644
--- a/packages/go_router_builder/example/lib/all_types.dart
+++ b/packages/go_router_builder/example/lib/all_types.dart
@@ -58,7 +58,7 @@
Widget drawerTile(BuildContext context) => ListTile(
title: const Text('BigIntRoute'),
onTap: () => go(context),
- selected: GoRouter.of(context).location == location,
+ selected: GoRouterState.of(context).location == location,
);
}
@@ -84,7 +84,7 @@
Widget drawerTile(BuildContext context) => ListTile(
title: const Text('BoolRoute'),
onTap: () => go(context),
- selected: GoRouter.of(context).location == location,
+ selected: GoRouterState.of(context).location == location,
);
}
@@ -107,7 +107,7 @@
Widget drawerTile(BuildContext context) => ListTile(
title: const Text('DateTimeRoute'),
onTap: () => go(context),
- selected: GoRouter.of(context).location == location,
+ selected: GoRouterState.of(context).location == location,
);
}
@@ -133,7 +133,7 @@
Widget drawerTile(BuildContext context) => ListTile(
title: const Text('DoubleRoute'),
onTap: () => go(context),
- selected: GoRouter.of(context).location == location,
+ selected: GoRouterState.of(context).location == location,
);
}
@@ -159,7 +159,7 @@
Widget drawerTile(BuildContext context) => ListTile(
title: const Text('IntRoute'),
onTap: () => go(context),
- selected: GoRouter.of(context).location == location,
+ selected: GoRouterState.of(context).location == location,
);
}
@@ -185,7 +185,7 @@
Widget drawerTile(BuildContext context) => ListTile(
title: const Text('NumRoute'),
onTap: () => go(context),
- selected: GoRouter.of(context).location == location,
+ selected: GoRouterState.of(context).location == location,
);
}
@@ -212,7 +212,7 @@
Widget drawerTile(BuildContext context) => ListTile(
title: const Text('EnumRoute'),
onTap: () => go(context),
- selected: GoRouter.of(context).location == location,
+ selected: GoRouterState.of(context).location == location,
);
}
@@ -239,7 +239,7 @@
Widget drawerTile(BuildContext context) => ListTile(
title: const Text('EnhancedEnumRoute'),
onTap: () => go(context),
- selected: GoRouter.of(context).location == location,
+ selected: GoRouterState.of(context).location == location,
);
}
@@ -265,7 +265,7 @@
Widget drawerTile(BuildContext context) => ListTile(
title: const Text('StringRoute'),
onTap: () => go(context),
- selected: GoRouter.of(context).location == location,
+ selected: GoRouterState.of(context).location == location,
);
}
@@ -288,7 +288,7 @@
Widget drawerTile(BuildContext context) => ListTile(
title: const Text('UriRoute'),
onTap: () => go(context),
- selected: GoRouter.of(context).location == location,
+ selected: GoRouterState.of(context).location == location,
);
}
@@ -361,7 +361,7 @@
Widget drawerTile(BuildContext context) => ListTile(
title: const Text('IterableRoute'),
onTap: () => go(context),
- selected: GoRouter.of(context).location == location,
+ selected: GoRouterState.of(context).location == location,
);
}
@@ -430,7 +430,7 @@
Widget drawerTile(BuildContext context) => ListTile(
title: const Text('IterableRouteWithDefaultValues'),
onTap: () => go(context),
- selected: GoRouter.of(context).location == location,
+ selected: GoRouterState.of(context).location == location,
);
}
@@ -536,7 +536,7 @@
Text(
'Query param with default value: $queryParamWithDefaultValue',
),
- SelectableText(GoRouter.of(context).location),
+ SelectableText(GoRouterState.of(context).location),
],
),
),
diff --git a/packages/go_router_builder/example/lib/shell_route_example.dart b/packages/go_router_builder/example/lib/shell_route_example.dart
index 2662ba8..979a31e 100644
--- a/packages/go_router_builder/example/lib/shell_route_example.dart
+++ b/packages/go_router_builder/example/lib/shell_route_example.dart
@@ -77,7 +77,7 @@
final Widget child;
int getCurrentIndex(BuildContext context) {
- final String location = GoRouter.of(context).location;
+ final String location = GoRouterState.of(context).location;
if (location == '/bar') {
return 1;
}
diff --git a/packages/go_router_builder/example/lib/shell_route_with_keys_example.dart b/packages/go_router_builder/example/lib/shell_route_with_keys_example.dart
index bc6521e..b97ed47 100644
--- a/packages/go_router_builder/example/lib/shell_route_with_keys_example.dart
+++ b/packages/go_router_builder/example/lib/shell_route_with_keys_example.dart
@@ -57,7 +57,7 @@
final Widget child;
int getCurrentIndex(BuildContext context) {
- final String location = GoRouter.of(context).location;
+ final String location = GoRouterState.of(context).location;
if (location.startsWith('/users')) {
return 1;
}
diff --git a/packages/go_router_builder/example/pubspec.yaml b/packages/go_router_builder/example/pubspec.yaml
index 766952e..4f83343 100644
--- a/packages/go_router_builder/example/pubspec.yaml
+++ b/packages/go_router_builder/example/pubspec.yaml
@@ -8,7 +8,7 @@
dependencies:
flutter:
sdk: flutter
- go_router: ^7.0.0
+ go_router: ^9.0.3
provider: 6.0.5
dev_dependencies:
diff --git a/packages/go_router_builder/pubspec.yaml b/packages/go_router_builder/pubspec.yaml
index cc76e16..81b6d54 100644
--- a/packages/go_router_builder/pubspec.yaml
+++ b/packages/go_router_builder/pubspec.yaml
@@ -2,7 +2,7 @@
description: >-
A builder that supports generated strongly-typed route helpers for
package:go_router
-version: 2.2.1
+version: 2.2.2
repository: https://github.com/flutter/packages/tree/main/packages/go_router_builder
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+go_router_builder%22