From edb2367cf85a0958827d0e3fcc3c93f9506d525f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=ED=99=8D=EC=A2=85=ED=91=9C?= <54665433+jpoh281@users.noreply.github.com> Date: Thu, 29 Sep 2022 03:11:15 +0900 Subject: [PATCH] [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> --- packages/go_router/CHANGELOG.md | 4 ++++ packages/go_router/example/lib/async_redirection.dart | 4 +--- packages/go_router/example/lib/books/main.dart | 4 +--- packages/go_router/example/lib/shell_route.dart | 4 +--- packages/go_router/pubspec.yaml | 2 +- 5 files changed, 8 insertions(+), 10 deletions(-) diff --git a/packages/go_router/CHANGELOG.md b/packages/go_router/CHANGELOG.md index e24e222a80..5d6e28f699 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 918fadab9a..14598a0e38 100644 --- a/packages/go_router/example/lib/async_redirection.dart +++ b/packages/go_router/example/lib/async_redirection.dart @@ -30,9 +30,7 @@ class App extends StatelessWidget { // 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 7ee88203e5..16068d6668 100644 --- a/packages/go_router/example/lib/books/main.dart +++ b/packages/go_router/example/lib/books/main.dart @@ -31,9 +31,7 @@ class Bookstore extends StatelessWidget { 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 6a1921d94c..b33c0bbba7 100644 --- a/packages/go_router/example/lib/shell_route.dart +++ b/packages/go_router/example/lib/shell_route.dart @@ -89,9 +89,7 @@ class ShellRouteExampleApp extends StatelessWidget { 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 226e641b06..3f45de022a 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