fix(share_plus): fix shareUri method adding sharePositionOrigin parameter.
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.mdnor the plugin version inpubspec.yamlfiles. - [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.
It might make sense to add in the subject parameter while you are at it, just to completely match the signature of Share.share
Thanks for the contribution @rodruiz I will take a look at it.
It might make sense to add in the
subjectparameter while you are at it, just to completely match the signature ofShare.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!
box position looks good!
Sorry, I forgot to merge this one. Going to merge main, and probably will merge after if everything is still good.