feat(share_plus): Avoid exceptions on iPads with no sharePositionOrigin - #3769
Merged
vbuberen merged 6 commits intoJul 18, 2026
Conversation
slightfoot
approved these changes
Mar 12, 2026
fernandobka
approved these changes
Mar 13, 2026
3 tasks
…Origin - Convert sharePositionOrigin from window to source view coordinates - Use center fallback when no valid origin is provided on iPad - iPhone behavior unchanged Closes fluttercommunity#3768
vbuberen
force-pushed
the
fix/share-plus-ipad-crash-no-sharePositionOrigin
branch
from
July 18, 2026 16:59
965365a to
45df6f4
Compare
vbuberen
approved these changes
Jul 18, 2026
vbuberen
left a comment
Collaborator
There was a problem hiding this comment.
Works correctly. Updated docs as well to mention this change.
4 tasks done
6 of 7 tasks
vbuberen
pushed a commit
to m1roxx/plus_plugins
that referenced
this pull request
Sep 26, 2026
Since Xcode 26, `UIActivityViewController.popoverPresentationController` is non-nil on iPhone as well, where it returns a private `_UIActivityViewControllerPresentationController` instead of a real `UIPopoverPresentationController`. The plugin set `sourceView` unconditionally and, on iPhone with a non-empty `sharePositionOrigin`, also set `sourceRect`. Both configure anchored presentation on a controller that is not a popover controller on iPhone. Restrict every popover configuration to iPad, which is what the surrounding comment already stated as the intent. iPad behaviour, including the centre-of-view fallback added in fluttercommunity#3769, is unchanged.
vbuberen
pushed a commit
to m1roxx/plus_plugins
that referenced
this pull request
Sep 30, 2026
Since Xcode 26, `UIActivityViewController.popoverPresentationController` is non-nil on iPhone as well, where it returns a private `_UIActivityViewControllerPresentationController` instead of a real `UIPopoverPresentationController`. The plugin set `sourceView` unconditionally and, on iPhone with a non-empty `sharePositionOrigin`, also set `sourceRect`. Both configure anchored presentation on a controller that is not a popover controller on iPhone. Restrict every popover configuration to iPad, which is what the surrounding comment already stated as the intent. iPad behaviour, including the centre-of-view fallback added in fluttercommunity#3769, is unchanged.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Changes
sharePositionOriginfrom window to source view coordinates usingconvertRect:fromView:nilbefore settingsourceRectFlutterErrorwhen no valid origin is providedBackwards compatibility
sharePositionOrigin: Previously could crash; now works (center fallback)sharePositionOrigin: Popover now anchors correctly; no API changesDescription
Fixes share sheet crash on iPad (iOS 17–26) when
sharePositionOriginis missing or in the wrong coordinate space.Related Issues
Checklist
CHANGELOG.mdnor the plugin version inpubspec.yamlfiles.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?
!in the title as explained in Conventional Commits).Changes
sharePositionOriginfrom window to source view coordinates usingconvertRect:fromView:nilbefore settingsourceRectFlutterErrorwhen no valid origin is providedBackwards compatibility
sharePositionOrigin: Previously could crash; now works (center fallback)sharePositionOrigin: Popover now anchors correctly; no API changes