[go_router]CHANGE EXAMPLE Provider, Delegate, Parser to routerConfig (#2649)
* [go_router] CHANGE Provider, Delegate, Parser to routerConfig
* Upgrade Verison
* Update packages/go_router/CHANGELOG.md
Co-authored-by: chunhtai <47866232+chunhtai@users.noreply.github.com>
Co-authored-by: chunhtai <47866232+chunhtai@users.noreply.github.com>
diff --git a/packages/go_router/CHANGELOG.md b/packages/go_router/CHANGELOG.md
index e24e222..5d6e28f 100644
--- a/packages/go_router/CHANGELOG.md
+++ b/packages/go_router/CHANGELOG.md
@@ -1,3 +1,7 @@
+## 5.0.3
+
+- Changes examples to use the routerConfig API
+
## 5.0.2
- Fixes missing code example in ShellRoute documentation.
diff --git a/packages/go_router/example/lib/async_redirection.dart b/packages/go_router/example/lib/async_redirection.dart
index 918fada..14598a0 100644
--- a/packages/go_router/example/lib/async_redirection.dart
+++ b/packages/go_router/example/lib/async_redirection.dart
@@ -30,9 +30,7 @@
// add the login info into the tree as app state that can change over time
@override
Widget build(BuildContext context) => MaterialApp.router(
- routeInformationProvider: _router.routeInformationProvider,
- routeInformationParser: _router.routeInformationParser,
- routerDelegate: _router.routerDelegate,
+ routerConfig: _router,
title: title,
debugShowCheckedModeBanner: false,
);
diff --git a/packages/go_router/example/lib/books/main.dart b/packages/go_router/example/lib/books/main.dart
index 7ee8820..16068d6 100644
--- a/packages/go_router/example/lib/books/main.dart
+++ b/packages/go_router/example/lib/books/main.dart
@@ -31,9 +31,7 @@
Widget build(BuildContext context) => BookstoreAuthScope(
notifier: _auth,
child: MaterialApp.router(
- routeInformationProvider: _router.routeInformationProvider,
- routerDelegate: _router.routerDelegate,
- routeInformationParser: _router.routeInformationParser,
+ routerConfig: _router,
),
);
diff --git a/packages/go_router/example/lib/shell_route.dart b/packages/go_router/example/lib/shell_route.dart
index 6a1921d..b33c0bb 100644
--- a/packages/go_router/example/lib/shell_route.dart
+++ b/packages/go_router/example/lib/shell_route.dart
@@ -89,9 +89,7 @@
theme: ThemeData(
primarySwatch: Colors.blue,
),
- routeInformationParser: _router.routeInformationParser,
- routerDelegate: _router.routerDelegate,
- routeInformationProvider: _router.routeInformationProvider,
+ routerConfig: _router,
);
}
}
diff --git a/packages/go_router/pubspec.yaml b/packages/go_router/pubspec.yaml
index 226e641..3f45de0 100644
--- a/packages/go_router/pubspec.yaml
+++ b/packages/go_router/pubspec.yaml
@@ -1,7 +1,7 @@
name: go_router
description: A declarative router for Flutter based on Navigation 2 supporting
deep linking, data-driven routes and more
-version: 5.0.2
+version: 5.0.3
repository: https://github.com/flutter/packages/tree/main/packages/go_router
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+go_router%22