-
Notifications
You must be signed in to change notification settings - Fork 29.8k
Prepare Flutter for SDK changes to runZoned.
#52953
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
The `runZoned` method deprecates the `onError` parameter. Invocations using that parameter must use `runZonedGuarded` instead. This prepares Flutter for the deprecation. The same places need to be migrated to using `runZonedGuarded` when the SDK change has been ported to Flutter. Then the deprecated member will be removed in a follow-up CL when the most important packages have been migrated.
zanderso
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The 'guarded' suffix on Zone calls implies that the error handling is slightly different afaiu. Is that the case here, or is the only difference that runZoneGuarded accepts onError and can return null?
|
The difference is that in
(And that the |
|
So, sorry if I'm misunderstanding the docs, but for example, there is a difference in the behavior of |
|
Yes, I have updated the breaking-change issue, which was showing the first proposed change, not the bigger-but-long-term-better change that we ended up with. |
|
(I can't commit to the Flutter repository, so someone with commit rights need to press the button). |
|
I filed #53185 to track switching over. |
Description
Inserts 5 counts of
// ignore: deprecated_member_use.The
runZonedmethod deprecates theonErrorparameter.Invocations using that parameter must use
runZonedGuardedinstead.This prepares Flutter for the deprecation. The same places need to be migrated to using
runZonedGuardedwhen the SDK change has been ported to Flutter.Then the deprecated member will be removed in a follow-up CL when the most important
packages have been migrated.
This change is needed to enable landing the initial Dart SDK change, which must happen before the migration can begin. See: https://dart-review.googlesource.com/c/sdk/+/137302/24
Related Issues
dart-lang/sdk#40681