-
Notifications
You must be signed in to change notification settings - Fork 9.8k
[camera] Restore compatibility with older Flutter #4885
[camera] Restore compatibility with older Flutter #4885
Conversation
flutter#4808 accidentally broke compatibility with pre-2.10 version of Flutter (without a corresponding min version change). This restores compatibility, since doing so is trivial. Fixes flutter/flutter#98660
It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact Hixie on the #hackers channel in Chat (don't just cc him here, he won't see it! He's on Discord!). If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix? Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. |
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.
LGTM
test-exempt: code refactor with no semantic change |
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.
Shoot, I didn't remember that we use unawaited
. Should we stop using it?
// TODO(stuartmorgan): Remove this once the package requires 2.10, where the | ||
// dart:async `unawaited` accepts a nullable future. | ||
void _unawaited(Future<void>? future) {} |
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.
QQ: What about using // ignore:unawaited_futures
instead of the _unawaited/unawaited
function? AFAIK the function only slightly changes the syntax of the code for it to pass analysis... So we could as well be explicit telling the world that we want to ignore the lint where needed (and maybe then we don't have to revisit this later?).
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.
I thought about that, but since the SDK has unawaited
as a preferred way to do this, following that model seemed cleaner and more consistent with other code.
(Technically we could just remove this since we don't have that lint enabled right now, but I have on my TODO list turning it on and seeing how it works out. We took our settings from Flutter which has it disabled with a note about "too many false positives", but I don't know if that would be true for us, and we have caught bugs with it before.)
* google/master: [webview_flutter_wkwebview] Add support for `WKUIDelegate` (flutter#4809) [camera] Restore compatibility with older Flutter (flutter#4885) [ci.yaml] Migrate to Cocoon scheduler (flutter#4884) Roll Flutter from adafd66 to 93c0c04 (6 revisions) (flutter#4880) [shared_preferences] upgraded ios to using pigeon (flutter#4732)
#4808 accidentally broke
compatibility with pre-2.10 version of Flutter (without a corresponding
min version change). This restores compatibility, since doing so is
trivial.
Fixes flutter/flutter#98660
Pre-launch Checklist
dart format
.)[shared_preferences]
pubspec.yaml
with an appropriate new version according to the pub versioning philosophy, or this PR is exempt from version changes.CHANGELOG.md
to add a description of the change, following repository CHANGELOG style.///
).