plus_plugins icon indicating copy to clipboard operation
plus_plugins copied to clipboard

fix(share_plus): fix shareUri method adding sharePositionOrigin parameter.

Open rodruiz opened this issue 2 years ago • 1 comments

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

  • Fix #2464

Checklist

  • [x] I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • [x] I titled the PR using Conventional Commits.
  • [x] I did not modify the CHANGELOG.md nor the plugin version in pubspec.yaml files.
  • [x] All existing and new tests are passing.
  • [x] 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).
  • [x] No, this is not a breaking change.

rodruiz avatar Jan 09 '24 20:01 rodruiz

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

jmsheff avatar Jan 10 '24 20:01 jmsheff

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 https://github.com/fluttercommunity/plus_plugins/issues/1956), but I'd prefer if it can be done in a different PR. Anyone willing to do it, please go ahead!

miquelbeltran avatar Feb 27 '24 09:02 miquelbeltran

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

box position looks good!

miquelbeltran avatar Feb 27 '24 09:02 miquelbeltran

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

miquelbeltran avatar Mar 07 '24 11:03 miquelbeltran