-
Notifications
You must be signed in to change notification settings - Fork 9.8k
[image_picker_platform_interface] Introduce new PickedFile APIs. #2791
[image_picker_platform_interface] Introduce new PickedFile APIs. #2791
Conversation
Borrowed from Rody Davis' file_access package. Co-authored-by: Rody Davis <rody.davis.jr@gmail.com>
Run with flutter test / flutter test --platform chrome
All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter. We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the ℹ️ Googlers: Go here for more info. |
@googlebot I consent. |
CLAs look good, thanks! ℹ️ Googlers: Go here for more info. |
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!
|
||
/// Synchronously read the entire file contents as a string using the given [Encoding]. | ||
/// | ||
/// Throws Exception if the operation fails. |
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.
Let's also mention the default encoding
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.
You got it. I'll add the comment that it defaults to UTF8 and merge after this all goes green again.
…tter#2791) * Make API Async, so web can use objectUrls internally, instead of bytes. * Introduce the PickedFile class to have a more platform agnostic return. * Modify the platform interface to return PickedFiles. Run tests with flutter test / flutter test --platform chrome Co-authored-by: Rody Davis <rody.davis.jr@gmail.com>
…tter#2791) * Make API Async, so web can use objectUrls internally, instead of bytes. * Introduce the PickedFile class to have a more platform agnostic return. * Modify the platform interface to return PickedFiles. Run tests with flutter test / flutter test --platform chrome Co-authored-by: Rody Davis <rody.davis.jr@gmail.com>
…tter#2791) * Make API Async, so web can use objectUrls internally, instead of bytes. * Introduce the PickedFile class to have a more platform agnostic return. * Modify the platform interface to return PickedFiles. Run tests with flutter test / flutter test --platform chrome Co-authored-by: Rody Davis <rody.davis.jr@gmail.com>
Description
This change modifies the platform_interface to introduce the
PickedFile
type and the new APIs that make use of it.This also deprecates the old APIs, pointing people to the new ones.
This is the first step to release #2767
Related Issues
Checklist
Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes (
[x]
). This will ensure a smooth and quick review process.///
).flutter analyze
) does not report any problems on my PR.Breaking Change
Does your PR require plugin users to manually update their apps to accommodate your change?
Note: this is not a breaking change, but it requires users to migrate to non-deprecated methods.