Skip to content
This repository was archived by the owner on Jul 21, 2022. It is now read-only.
This repository was archived by the owner on Jul 21, 2022. It is now read-only.

Wrong Share modal position on tablet (iPad OS) #40

@divan

Description

@divan

Describe the bug
When I click on the button that triggers share action, on iPad OS (and, perhaps, on Android tablets?) the Share modal window appears, but it's located far from the actual button, and there is no way to specify position.

To Reproduce
Create Scaffold with action button that triggers Share action with this plugin. Run on iPad. Click on the button (which is on the top right side), and observe Share modal window appear in the top left corner.

Expected behavior
Share modal window appears close to the button that triggered the action.

Screenshots
IMG_5B0498EF26B0-1

Additional context
In the official Share plugin they have parameter for specifying the origin. It worked fine for me, when I was using that plugin: https://github.com/flutter/plugins/blob/master/packages/share/example/lib/main.dart#L69

Builder(
                  builder: (BuildContext context) {
                    return RaisedButton(
                      child: const Text('Share'),
                      onPressed: text.isEmpty
                          ? null
                          : () {
                              // A builder is used to retrieve the context immediately
                              // surrounding the RaisedButton.
                              //
                              // The context's `findRenderObject` returns the first
                              // RenderObject in its descendent tree when it's not
                              // a RenderObjectWidget. The RaisedButton's RenderObject
                              // has its position and size after it's built.
                              final RenderBox box = context.findRenderObject();
                              Share.share(text,
                                  subject: subject,
                                  sharePositionOrigin:
                                      box.localToGlobal(Offset.zero) &
                                          box.size);
                            },
                    );
                  },

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions