Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(share_plus): add sharePositionOrigin parameter to shareUri #2517

Merged

Conversation

rodruiz
Copy link
Contributor

@rodruiz rodruiz commented Jan 9, 2024

Description

share_plus requires iPad users to provide the sharePositionOrigin parameter. This parameter is not available in the shareUri method.

When the sharePositionOrigin parameter is not provided on iPads you will see the following error:

PlatformException (PlatformException(error, sharePositionOrigin: argument must be set, {{0, 0}, {0, 0}} must be non-zero and within coordinate space of source view: {{0, 0}, {1024, 1366}}, null, null))

This PR also:

  • Updates the tests. shareUri method was not included in the tests.
  • Updates and fixes the example.

Related Issues

Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I titled the PR using Conventional Commits.
  • I did not modify the CHANGELOG.md nor the plugin version in pubspec.yaml files.
  • All existing and new tests are passing.
  • The analyzer (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?

  • Yes, this is a breaking change (please indicate that with a ! in the title as explained in Conventional Commits).
  • No, this is not a breaking change.

@jmsheff
Copy link
Contributor

jmsheff commented Jan 10, 2024

It might make sense to add in the subject parameter while you are at it, just to completely match the signature of Share.share

@miquelbeltran miquelbeltran self-assigned this Feb 27, 2024
@miquelbeltran
Copy link
Member

Thanks for the contribution @rodruiz I will take a look at it.

It might make sense to add in the subject parameter while you are at it, just to completely match the signature of Share.share

I think it would be nice to have subject param as well (that may help with issues like #1956), but I'd prefer if it can be done in a different PR. Anyone willing to do it, please go ahead!

Copy link
Member

@miquelbeltran miquelbeltran left a comment

Choose a reason for hiding this comment

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

Code looks good, added one comment to improve code formatting.

For what I see, the iOS naive implementation was already in place, so only dart code needed changes.

I will do a quick test before final approval.

Thanks!

packages/share_plus/share_plus/example/lib/main.dart Outdated Show resolved Hide resolved
@miquelbeltran
Copy link
Member

Simulator Screenshot - iPad (10th generation) - 2024-02-27 at 10 16 25

box position looks good!

@miquelbeltran miquelbeltran changed the title fix(share_plus): fix shareUri method adding sharePositionOrigin parameter. fix(share_plus): add sharePositionOrigin parameter to shareUri Feb 27, 2024
@miquelbeltran
Copy link
Member

Sorry, I forgot to merge this one. Going to merge main, and probably will merge after if everything is still good.

@miquelbeltran miquelbeltran merged commit f896d94 into fluttercommunity:main Mar 7, 2024
17 of 19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Request]: sharePositionOrigin parameter for shareUri method
4 participants