[various] Fixes unawaited_futures violations (#4067)
This option had been disabled to match flutter/flutter, but the reason it was disabled there was "too many false positives", mostly around animation. That doesn't apply to most packages here, and we've had a number of production bugsâespecially in plugins, that use async heavily in ways that are intended to be client-awaitableâthat this would have caught.
This PR:
- Enables the option at the repo level.
- Permanently (unless the owners decide to change it) opts out animations and go_router, both of which looked like mostly or entirely false positives.
- Temporarily opted out a few plugins that have a lot of violations that should be handled in their own PRs later (camera_android_camerax, most of webview_flutter).
- Fixes all remaining violations.
In many cases this PR is behavior-changing, replacing implicitly unawaited futures that did not seem obviously intentional with awaited futures, so non-test code in particular should be reviewed carefully to make sure the changes are correct. All of the changes are manual, not fix-generated.
Part of https://github.com/flutter/flutter/issues/127323
[go_router] Fixes missing state.extra in onException() (#5077)
This will help in knowing the extra Object passed when the _non-existing-location_ was asked.
*List which issues are fixed by this PR. You must list at least one issue.*
- The issue looks small, I will create it if needed by the maintainers
*If you had to change anything in the [flutter/tests] repo, include a link to the migration guide as per the [breaking change policy].*
- No breaking changes
[go_router] Add support for preloading branches of StatefulShellRoute (revised solution) (#6467)
Adds support for preloading branches in a StatefulShellRoute. This functionality was initially part of an early implementation of flutter/packages#2650, however it was decided to implement this in a separate PR. The current implementation is a rewrite of the original implementation to better fit the final version of StatefulShellRoute (and go_router in general).
**NOTE**: this is a revised version of the initial solution (see flutter/packages#4251), containing a substantially simpler implementation made possible thanks to recent refactoring in go_router.
This fixes issue flutter/flutter#127804.
[go_router] [shell_route] Add observers parameter (#2664)
* [go_router] [shell_route] Add observers parameter
* [go_router] [shell_route] Add observers parameter test
* Added Licence for shell_route_observers_test.dart
* [go_router] [shell_route] Added type annotation to shell_route_observers_test.dart
* [go_router] [shell_route] Use HeroControllerScope for nested Navigator
* Use the correct HeroController based on the App type.
* Cache the HeroController for the nested Navigator.
* Clean up previous cache to prevent memory leak.
* Added better cache-clearing policy for the HeroController cache.
* Fixed Typos
Co-authored-by: chunhtai <47866232+chunhtai@users.noreply.github.com>
* Fixed Typos
Co-authored-by: chunhtai <47866232+chunhtai@users.noreply.github.com>
* [go_router] [shell_route] Added a better Hero test
Credits to @flodaniel!
---------
Co-authored-by: chunhtai <47866232+chunhtai@users.noreply.github.com>