Skip to content

Conversation

@mx1up
Copy link

@mx1up mx1up commented Oct 16, 2024

A breaking change has been released for the mime package: the return value of extensionFromMime function has become nullable. If there is no extension found for the mime type, null is now returned instead of the mimeType being passed. Or in code:

/// Returns the extension for the given MIME type.
///
/// If there are multiple extensions for [mime], return the first occurrence in
/// the map. If there are no extensions for [mime], return [mime].
String extensionFromMime(String mime) 

became

/// The default file extension for a given MIME type.
///
/// If [mimeType] has multiple associated extensions,
/// the returned string is one of those, chosen as the default
/// extension for that MIME type.
///
/// Returns `null` if [mimeType] is not a recognized and
/// supported MIME type.
String? extensionFromMime(String mimeType)

see dart-lang/tools#431 for more info.

Since I did not find any usages of this method in this package, I believe it's safe to loosen the constraint here.

List which issues are fixed by this PR. You must list at least one issue.

flutter/flutter#156976

Pre-launch Checklist

If you need help, consider asking for advice on the #hackers-new channel on Discord.

repository: https://github.com/flutter/packages/tree/main/packages/image_picker/image_picker_for_web
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+image_picker%22
version: 3.0.2
version: 3.0.3
Copy link
Author

Choose a reason for hiding this comment

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

not sure if i had to bump the version now

@stuartmorgan-g
Copy link
Collaborator

Thanks for the contribution, but #7879 is already in the submit queue and addresses this, so closing as a duplicate.

For any future PRs, please make sure you are using a current tree as your base; this branch is almost a year old, so isn't compatible with our CI.

@mx1up
Copy link
Author

mx1up commented Oct 17, 2024

hi @stuartmorgan thanks for the feedback. i thought i used a fresh fork but must have reused an old one, i'll pay attention to this next time!

@mx1up mx1up deleted the loosen_mime_constraint branch October 17, 2024 10:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants