-
Notifications
You must be signed in to change notification settings - Fork 9.8k
[image_picker_platform_interface] Migrate image_picker to package:cross_file #4072
Conversation
@BeMacized I've been going back and forth with this one for a couple of days, but we have some internal customers that would benefit greatly from this being a non-breaking change. Instead of changing the signature of the methods to return an XFile, could we add a new set of methods that return the new type, while keeping the old methods available (and mark them as deprecated?) That way our customers are going to be able to see the incoming change before forcing them to update their apps. At a later date, after a few months, or when the next inescapable major version comes, we can delete the deprecated methods and the PickedFile class :/ What do you think? |
@ditman If you believe this is something important enough that we should take that route, I'd say we do it. The only thing I'm a bit vague on atm is what the naming should be for the new alternatives to Do you happen to have any suggestions? |
@BeMacized I think we're at a point where we can reuse the names from v0.6, that have already been removed from everywhere :) I'd say we replace As for the LostData, we might reuse the names from the earlier version? There's some notes about the old method names here: https://pub.dev/documentation/image_picker/latest/#deprecation-warnings-in-pickimage-pickvideo-and-lostdataresponse |
@ditman Ah, that indeed sounds like a good idea! I'll see if I can update the PRs for this tomorrow. |
Thanks for the patience and extra work @BeMacized! |
@ditman Would it be possible for you to take another look? :) |
Really looking forward to this merged |
Apologies, I was working in fixing a framework P2, I'll get on this today. |
I just realized that making things
For other users the breakage might be different. I'll update this PR removing the That way people will get the deprecation warnings only once everything is in place for them to switch to the new code. Once the methods that are actually used by users are marked as deprecated, we can revisit this package and mark these as deprecated (even though it shouldn't be needed; they can be directly removed after the deprecated methods are removed from the core plugin). My bad, I'll fix this PR ASAP! |
…nce it gets published.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
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.
This looks good to me, I'll take an eye to the tests and see what's going on there (the branch needed a refresh from master
to pick some changes from earlier today).
@BeMacized, can you verify that you can still work on the other packages with my changes applied? Once you verify that you can still keep working, we can merge this change.
...cker/image_picker_platform_interface/lib/src/method_channel/method_channel_image_picker.dart
Outdated
Show resolved
Hide resolved
...cker/image_picker_platform_interface/lib/src/method_channel/method_channel_image_picker.dart
Outdated
Show resolved
Hide resolved
@ditman I can confirm the changes have no effect on the implementation PRs, they have been updated accordingly. |
Finally published: https://pub.dev/packages/image_picker_platform_interface/changelog#220 |
* upstream_master: (40 commits) [image_picker] Image picker fix camera device (flutter#3898) [flutter_plugin_tools] Improve license-check output (flutter#4154) [webview_flutter] Fix broken keyboard issue link (flutter#3266) [flutter_plugin_tools] Support format on Windows (flutter#4150) [flutter_plugin_tools] Make unit tests pass on Windows (flutter#4149) [image_picker_for_web] Migrate image_picker to package:cross_file (flutter#4083) [various] Prepare plugin repo for binding API improvements (flutter#4148) [quick_actions] Add const constructor (flutter#4131) [in_app_purchase] Add iOS currency symbol to ProductDetails (flutter#4144) [in_app_purchase] Added priceCurrencySymbol to SkuDetailsWrapper (flutter#4114) [image_picker_platform_interface] Add methods that return package:cross_file (flutter#4072) [flutter_plugin_tools] Improve and test 'format' (flutter#4145) [flutter_plugin_tools] Only check target packages in analyze (flutter#4146) [in_app_purchase] Fix crash when retrieveReceiptWithError gives an error. (flutter#4138) [video_player] Pause video when it completes (flutter#3727) [in_app_purchase] Add currencySymbol to ProductDetails (flutter#4115) [in_app_purchase] Add documentation for price change confirmations (flutter#4092) [camera] android-rework part 8: Supporting modules for final implementation (flutter#4054) [plugin_platform_interface] Fix README broken link (flutter#4143) [various] Prepare plugin repo for binding API improvements (flutter#4137) ...
Removed the PickedFile implementations and migrated the platform interface to make use of the
cross_file
library.Changes have been based on #3388.
Web implementation can be found in: #4083.
Android/iOS implementation can be found in #4073.
Relevant issue:
Pre-launch Checklist
dart format
.)[shared_preferences]
///
).If you need help, consider asking for advice on the #hackers-new channel on Discord.