This repository was archived by the owner on Feb 22, 2023. It is now read-only.
Repository navigation
[various] Enable avoid_dynamic_calls - #6834
Merged
auto-submit[bot] merged 18 commits intoJan 10, 2023
Merged
auto-submit[bot] merged 18 commits into
auto-submit[bot] merged 18 commits into
Conversation
stuartmorgan-g
requested review from
GaryQian,
bparrishMines,
camsim99,
cbracken,
cyanglaz,
ditman,
hellohuanlin,
jmagman and
tarrinneal
as code owners
December 12, 2022 19:57
stuartmorgan-g
force-pushed
the
analysis-avoid-dynamic-calls
branch
from
January 9, 2023 17:16
e474746 to
17fa814
Compare
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/flutter
that referenced
this pull request
Jan 10, 2023
auto-submit Bot
pushed a commit
to flutter/flutter
that referenced
this pull request
Jan 10, 2023
* d03de2fce [tool] Don't add Guava in the all-packages app (flutter-team-archive/plugins#6747) * d485c7e83 [local_auth]: Bump espresso-core (flutter-team-archive/plugins#6925) * a47e71988 [webview_flutter_platform_interface] Improves error message when `WebViewPlatform.instance` is null (flutter-team-archive/plugins#6938) * 7132dac0e [google_maps]: Bump espresso-core from 3.4.0 to 3.5.1 in /packages/google_maps_flutter/google_maps_flutter_android/android (flutter-team-archive/plugins#6937) * dc3287ccf [espresso]: Bump truth from 1.4.0 to 1.5.0 in /packages/espresso/android (flutter-team-archive/plugins#6707) * 1de6477bd [camera]: Bump camerax_version from 1.3.0-alpha01 to 1.3.0-alpha02 in /packages/camera/camera_android_camerax/android (flutter-team-archive/plugins#6828) * fb405819e [shared_preferences] Merge iOS and macOS implementations (flutter-team-archive/plugins#6920) * 9fdc899b7 [various] Enable `avoid_dynamic_calls` (flutter-team-archive/plugins#6834)
esouthren
pushed a commit
to esouthren/flutter
that referenced
this pull request
Jan 15, 2023
…#118253) * d03de2fce [tool] Don't add Guava in the all-packages app (flutter-team-archive/plugins#6747) * d485c7e83 [local_auth]: Bump espresso-core (flutter-team-archive/plugins#6925) * a47e71988 [webview_flutter_platform_interface] Improves error message when `WebViewPlatform.instance` is null (flutter-team-archive/plugins#6938) * 7132dac0e [google_maps]: Bump espresso-core from 3.4.0 to 3.5.1 in /packages/google_maps_flutter/google_maps_flutter_android/android (flutter-team-archive/plugins#6937) * dc3287ccf [espresso]: Bump truth from 1.4.0 to 1.5.0 in /packages/espresso/android (flutter-team-archive/plugins#6707) * 1de6477bd [camera]: Bump camerax_version from 1.3.0-alpha01 to 1.3.0-alpha02 in /packages/camera/camera_android_camerax/android (flutter-team-archive/plugins#6828) * fb405819e [shared_preferences] Merge iOS and macOS implementations (flutter-team-archive/plugins#6920) * 9fdc899b7 [various] Enable `avoid_dynamic_calls` (flutter-team-archive/plugins#6834)
fluttermirroringbot
pushed a commit
to flutter/flutter
that referenced
this pull request
Jan 16, 2023
Enables the
avoid_dynamic_callslint, to bring us into better alignment with flutter/flutter lints.There are some miscellaneous changes, but the large majority of these are cases where platform channel code was using
dynamicvalues directly (usually for method call arguments). Common changes:dynamicto aMapfor method call arguments.someDynamicVarible as NonNullableTypecompiles, whilesomeObject?Variable as NonNullableTypedoesn't and needs an explicit force-unwrap (due to another lint we already have enabled).Since these changes aren't mechanical, and can cause runtime exceptions, they should be reviewed carefully (as we may well not have complete test coverage of all touched lines). In particular, please check that any
as List<...>oras Map<..., ...>isn't using any types other thandynamicorObject?, as anything else is likely to be an exception-causing bug. (The correct construction for better typing is something like(... as Map<Object?, Object?>).cast<AType, AnotherType>().)In general I preferred using
Object?for updated code, per modern Dart style, but in some cases where there was already significant explicit use ofdynamicI kept that style to minimize disruption. We may want to separately clean up areas of code still usingdynamicat another time. Although ideally, we would replace most of the code here with Pigeon and avoid the need for manual, error-prone casting at all.Part of flutter/flutter#76229
Pre-launch Checklist
dart format.)[shared_preferences]pubspec.yamlwith an appropriate new version according to the pub versioning philosophy, or this PR is exempt from version changes.CHANGELOG.mdto add a description of the change, following repository CHANGELOG style.///).