[go_router] Refactor internal classes and methods (#2317)

* Refactor internal classes and methods

- Separate matching from redirection
- Add RouteRedirector typedef
- Add RouteMatcher class
- Add RouteBuilder class
- Add RouteConfiguration class
- Rename and reorganize internal classes and libraries
- Add todo comments

* format

* Sort imports

* Update changelog

* Address code review comments

- Change name back to GoRouterRefreshStream
- Update toString() methods for new naming
- Make fields final
- Add logging to parser
- Add comments
- add tests
- Move function-scope to new library-scope _addRedirect function
- import widgets instead of material where possible

* remove routing library

* Move classes in go_router.dart into separate libraries

* Move Configuration.validate() into constructor

* Remove comment

* use continue in redirect loop

* Fix comments

* Sort imports

* Fix logging in configuration

* add visibleForTesting annotation

* Updates from merge with main

* Format

* Add TODOs to make Router implementation classes private

* Add copyright headers

* Fix tests

* format

* fix comment

* Update packages/go_router/lib/src/parser.dart

Co-authored-by: Loïc Sharma <737941+loic-sharma@users.noreply.github.com>

* add whitespace

* format

* Hide typedefs that weren't previously exported

* Delete empty file

* add missing import

* Specify version 4.1.2 in pubspec.yaml

* Update packages/go_router/lib/src/builder.dart

Co-authored-by: chunhtai <47866232+chunhtai@users.noreply.github.com>

* Fix comment

* Add isError and error getters to RouteMatchList

* Add issue links to TODO comments

* Add link to issue for TODO

* Re-apply code from #2306 due to merge conflicts

* Add issue references

Co-authored-by: Loïc Sharma <737941+loic-sharma@users.noreply.github.com>
Co-authored-by: chunhtai <47866232+chunhtai@users.noreply.github.com>
48 files changed
tree: 4a1243c6a6bb6308d33738669440b6cd6cf55718
  1. .ci/
  2. .github/
  3. packages/
  4. script/
  5. third_party/
  6. .ci.yaml
  7. .cirrus.yml
  8. .clang-format
  9. .gitattributes
  10. .gitignore
  11. .gitmodules
  12. .metadata
  13. analysis_options.yaml
  14. AUTHORS
  15. CONTRIBUTING.md
  16. customer_testing.bat
  17. customer_testing.sh
  18. LICENSE
  19. README.md
README.md

Flutter Packages

Build Status Release Status

This repo is a companion repo to the main flutter repo. It contains the source code for Flutter's first-party packages (i.e., packages developed by the core Flutter team). Check the packages directory to see all packages.

These packages are also available on pub.

Issues

Please file any issues, bugs, or feature requests in the main flutter repo.

Contributing

If you wish to contribute a new package to the Flutter ecosystem, please see the documentation for developing packages. You can store your package source code in any GitHub repository (the present repo is only intended for packages developed by the core Flutter team). Once your package is ready you can publish to the pub repository.

If you wish to contribute a change to any of the existing packages in this repo, please review our contribution guide, and send a pull request.

Packages

These are the available packages in this repository.

PluginPubIssuesPull requests
animationspub packageGitHub issues by-labelGitHub pull requests by-label
css_colorspub packageGitHub issues by-labelGitHub pull requests by-label
extension_google_sign_in_as_googleapis_authpub packageGitHub issues by-labelGitHub pull requests by-label
fuchsia_ctlpub packageGitHub issues by-labelGitHub pull requests by-label
flutter_imagepub packageGitHub issues by-labelGitHub pull requests by-label
flutter_lintspub packageGitHub issues by-labelGitHub pull requests by-label
flutter_markdownpub packageGitHub issues by-labelGitHub pull requests by-label
go_routerpub packageGitHub issues by-labelGitHub pull requests by-label
go_router_builderpub packageGitHub issues by-labelGitHub pull requests by-label
multicast_dnspub packageGitHub issues by-labelGitHub pull requests by-label
palette_generatorpub packageGitHub issues by-labelGitHub pull requests by-label
pigeonpub packageGitHub issues by-labelGitHub pull requests by-label
pointer_interceptorpub packageGitHub issues by-labelGitHub pull requests by-label
xdg_directoriespub packageGitHub issues by-labelGitHub pull requests by-label