Skip to content

Conversation

@stuartmorgan-g
Copy link
Collaborator

Deprecates all of the platform interface methods that have been replaced with newer variants.

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/packages repo does use dart format.)
  • I signed the CLA.
  • The title of the PR starts with the name of the package 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-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.

@Hixie
Copy link
Contributor

Hixie commented Jul 19, 2023

test-exempt: roll dependency

@stuartmorgan-g stuartmorgan-g added the autosubmit Merge PR when tree becomes green via auto submit App label Jul 19, 2023
@auto-submit auto-submit bot merged commit 674179f into flutter:main Jul 19, 2023
/// in this call. You can then call [getLostData] when your app relaunches to retrieve the lost data.
///
/// If no images were picked, the return value is null.
@Deprecated('Use getImageFromSource instead.')
Copy link
Member

@ditman ditman Jul 19, 2023

Choose a reason for hiding this comment

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

getImageFromSource uses getImage in this file:

  Future<XFile?> getImageFromSource({
    required ImageSource source,
    ImagePickerOptions options = const ImagePickerOptions(),
  }) {
    return getImage(
      source: source,
      maxHeight: options.maxHeight,
      maxWidth: options.maxWidth,
      imageQuality: options.imageQuality,
      preferredCameraDevice: options.preferredCameraDevice,
    );
  }

Should we flip the default implementation so the deprecated method calls the recommended one internally?

(At least in the platform implementations, so we don't extend deprecated methods?)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

getImageFromSource uses getImage in this file:

That's the default, not very good implementation, which platform implementations should override with a real one. See the paragraph starting "Note:" in https://github.com/flutter/flutter/wiki/Contributing-to-Plugins-and-Packages#changing-platform-interface-method-parameters

Should we flip the default implementation so the deprecated method calls the recommended one internally?

That would suddenly make all old implementations throw when used with newer versions of the app-facing package.

Copy link
Member

Choose a reason for hiding this comment

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

The delegation of this method will feel backwards, because the implementing the new method in terms of the old method will discard the information from the new parameters. This is correct though, because the goal is to allow the app-facing package to call the new method regardless of whether implementation packages have implemented it.

Yep, exactly.

I'll flip the web implementation so the deprecated methods are based off of the new ones, so we can eventually remove the deprecated methods later!

engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jul 20, 2023
auto-submit bot pushed a commit to flutter/flutter that referenced this pull request Jul 20, 2023
flutter/packages@209db21...674179f

2023-07-19 [email protected] [image_picker] Deprecate platform interface methods (flutter/packages#4520)
2023-07-19 [email protected] [go_router] Adds a parentNavigatorKey parameter to ShellRouteData. (flutter/packages#4409)
2023-07-19 [email protected] [ci] Shard Windows Dart unit tests (flutter/packages#4519)
2023-07-19 [email protected] Roll Flutter from 6f09064 to d07e8ae (60 revisions) (flutter/packages#4522)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages-flutter-autoroll
Please CC [email protected],[email protected] on the revert to ensure that a human
is aware of the problem.

To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
LouiseHsu pushed a commit to LouiseHsu/flutter that referenced this pull request Jul 31, 2023
flutter/packages@209db21...674179f

2023-07-19 [email protected] [image_picker] Deprecate platform interface methods (flutter/packages#4520)
2023-07-19 [email protected] [go_router] Adds a parentNavigatorKey parameter to ShellRouteData. (flutter/packages#4409)
2023-07-19 [email protected] [ci] Shard Windows Dart unit tests (flutter/packages#4519)
2023-07-19 [email protected] Roll Flutter from 6f09064 to d07e8ae (60 revisions) (flutter/packages#4522)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages-flutter-autoroll
Please CC [email protected],[email protected] on the revert to ensure that a human
is aware of the problem.

To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

autosubmit Merge PR when tree becomes green via auto submit App p: image_picker

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants