Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.

[camera] Restore compatibility with older Flutter #4885

Merged
merged 1 commit into from
Feb 17, 2022

Conversation

stuartmorgan-g
Copy link
Contributor

#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

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read and followed the relevant style guides and ran the auto-formatter. (Unlike the flutter/flutter repo, the flutter/plugins repo does use dart format.)
  • I signed the CLA.
  • The title of the PR starts with the name of the plugin surrounded by square brackets, e.g. [shared_preferences]
  • I listed at least one issue that this PR fixes in the description above.
  • I updated pubspec.yaml with an appropriate new version according to the pub versioning philosophy, or this PR is exempt from version changes.
  • I updated CHANGELOG.md to add a description of the change, following repository CHANGELOG style.
  • I updated/added relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making, or this PR is test-exempt.
  • All existing and new tests are passing.

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
@flutter-dashboard
Copy link

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.

Copy link
Contributor

@mvanbeusekom mvanbeusekom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Hixie
Copy link
Contributor

Hixie commented Feb 17, 2022

test-exempt: code refactor with no semantic change

Copy link
Member

@ditman ditman left a 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?

Comment on lines +32 to +34
// TODO(stuartmorgan): Remove this once the package requires 2.10, where the
// dart:async `unawaited` accepts a nullable future.
void _unawaited(Future<void>? future) {}
Copy link
Member

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?).

Copy link
Contributor Author

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.)

@stuartmorgan-g stuartmorgan-g added the waiting for tree to go green (Use "autosubmit") This PR is approved and tested, but waiting for the tree to be green to land. label Feb 17, 2022
@fluttergithubbot fluttergithubbot merged commit aa7a474 into flutter:main Feb 17, 2022
debokarmakar pushed a commit to nurture-farm/plugins that referenced this pull request Feb 18, 2022
* 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)
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Feb 18, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
needs tests p: camera waiting for tree to go green (Use "autosubmit") This PR is approved and tested, but waiting for the tree to be green to land.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Camera: Incompatible version 0.9.4+12
5 participants