fluttercommunity / fluttercommunity/plus_plugins

[Request]: share_plus: option to present the iPad share sheet without a popover arrow

オープン
#3,973 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
enhancement triage
主要言語
Dart
スター
1.9k
フォーク
1.3k
PR マージ指標
30日以内にマージされた PR はありません

説明

### Plugin

share_plus

### Use case

On iPad the share sheet is a popover, and a popover has an arrow pointing at whatever rect was passed as `sharePositionOrigin`. That is right when the sheet was opened from a visible control. It is wrong whenever there is no such control: a keyboard shortcut, a finished background export, an action whose source has already scrolled away. Any rect passed in those cases is arbitrary, and iPadOS then draws an arrow pointing at a spot the user never touched.

Since 13.3.0 the plugin centres the sheet when no origin is given, which is the correct position — the arrow still points into empty space next to it.

There is no way around this from application code: `ShareParams` exposes `sharePositionOrigin` and nothing else that reaches `UIPopoverPresentationController`, and `permittedArrowDirections` does not appear anywhere in the iOS plugin. Other share packages on pub.dev wrap the same `UIActivityViewController`, so they inherit the same behaviour.

This was previously requested in #359 (July 2021), which the stale bot closed in June 2022 without any human reply; that issue is now locked, so I could not comment there. flutter/flutter#74552 asks for the same thing and is still open. Both name the same reference: the export sheet in Procreate, which is centred and arrow-free.

### Proposal

Expose the arrow configuration, ignored on every platform other than iOS/macOS. Two parts that can be judged separately:

**1. Pass `permittedArrowDirections` through.** Fully documented and mechanical. [`permittedArrowDirections`](https://developer.apple.com/documentation/uikit/uipopoverpresentationcontroller/permittedarrowdirections) is settable since iOS 8 and defaults to `any`; [`UIPopoverArrowDirection`](https://developer.apple.com/documentation/uikit/uipopoverarrowdirection) is an `OptionSet`, so `up`/`down`/`left`/`right` map one-to-one.

**2. An option for "centred, no arrow".** This is the part that closes the request, and the implementation deserves a decision rather than a guess, so here is what I measured on an iPad Air 13-inch (M4) simulator, iPadOS 26.5, presenting a `UIActivityViewController` exactly as the plugin does:

- **An empty option set works.** With `popover.permittedArrowDirections = []` and a 2×2 `sourceRect` in the centre of the view, the sheet appears centred with no arrow at all, and [`arrowDirection`](https://developer.apple.com/documentation/uikit/uipopoverpresentationcontroller/arrowdirection) reads `0` afterwards. It is not *documented* to work, though — Apple describes `unknown` only as "The status of the arrow is currently unknown" and says nothing about suppression.
- **`sourceItem` does not help.** The docs say that for [`sourceItem`](https://developer.apple.com/documentation/uikit/uipopoverpresentationcontroller/sourceitem), "In iOS 26 and later, the popover animates from and replaces the specified item" — but that paragraph is about `UIBarButtonItem`/`NSToolbarItem`. Anchoring to a plain `UIView`, which [`UIPopoverPresentationControllerSourceItem`](https://developer.apple.com/documentation/uikit/uipopoverpresentationcontrollersourceitem) also accepts, still drew an arrow on iPadOS 26.5 (`arrowDirection` = `2`, i.e. `down`). So the iOS 26 behaviour does not generalise to view items, and Flutter apps have no bar item to anchor to.

I am aware CONTRIBUTING rules out features covering only one platform, and an arrow only exists on iOS and macOS. `sharePositionOrigin` has exactly the same scope, so there is precedent for a platform-specific parameter here — but I would rather ask than assume. Happy to implement whichever half you consider acceptable.

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

share_plus の iOS/macOS UIActivityViewController の表示エントリポイントから始め、ShareParams.sharePositionOrigin が UIPopoverPresentationController にどのように渡されるかを確認します。permittedArrowDirections、中央揃えの矢印なしオプション、またはその両方を公開するかどうかを決定し、その後、選択した動作を示すプラットフォーム固有のテストとドキュメントを追加します。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
dart, flutter, ios, macos
領域
desktop, mobile
issue の種類
機能追加
難易度
5/5
見積もり時間
1週間以上
活発さ
活発
明瞭さ
おおむね明確
初心者へのやさしさ
48/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。