Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does not work on iPad #24

Open
5stones1sling opened this issue Feb 27, 2020 · 9 comments
Open

Does not work on iPad #24

5stones1sling opened this issue Feb 27, 2020 · 9 comments

Comments

@5stones1sling
Copy link

Probably at least one of the constraints in the following list is one you don't want.
Try this:
(1) look at each constraint and try to figure out which you don't expect;
(2) find the code that added the unwanted constraint or constraints and fix it.
(
"<NSLayoutConstraint:0x600000fefed0 LPLinkView:0x7fa278633570.leading == UILayoutGuide:0x6000015bbb80'UIViewLayoutMarginsGuide'.leading (active)>",
"<NSLayoutConstraint:0x600000fee440 H:[LPLinkView:0x7fa278633570]-(59)-| (active, names: '|':_UIActivityContentTitleView:0x7fa278447c90 )>",
"<NSLayoutConstraint:0x600000f832f0 H:|-(0)-[_UIActivityContentTitleView:0x7fa278447c90] (active, names: '|':_UINavigationBarContentView:0x7fa2785611b0 )>",
"<NSLayoutConstraint:0x600000f81b30 _UIActivityContentTitleView:0x7fa278447c90.trailing == _UINavigationBarContentView:0x7fa2785611b0.trailing (active)>",
"<NSLayoutConstraint:0x600000feac60 'UIView-Encapsulated-Layout-Width' _UINavigationBarContentView:0x7fa2785611b0.width == 6 (active)>",
"<NSLayoutConstraint:0x600000fefde0 'UIView-leftMargin-guide-constraint' H:|-(16)-UILayoutGuide:0x6000015bbb80'UIViewLayoutMarginsGuide' (active, names: '|':_UIActivityContentTitleView:0x7fa278447c90 )>"
)

Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x600000fefed0 LPLinkView:0x7fa278633570.leading == UILayoutGuide:0x6000015bbb80'UIViewLayoutMarginsGuide'.leading (active)>

Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.
The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKitCore/UIView.h> may also be helpful.

@rdev-software
Copy link

Same here

@rdev-software
Copy link

I think I resolved my issue by providing Rect:
WidgetPosition shareButtonPosition = WidgetPosition.fromContext(shareButtonKey.currentContext);

Widget position class from https://www.didierboelens.com/2018/09/reactive-button/

@5stones1sling
Copy link
Author

I tried to use flutter_reactive_button but I am seeing this error because I am using bloc 2.0.0

Because flutter_reactive_button >=1.1.0 depends on rxdart ^0.21.0 and bloc 2.0.0 depends on rxdart ^0.22.0, flutter_reactive_button >=1.1.0 is incompatible with bloc 2.0.0.

And because no versions of bloc match >2.0.0 <3.0.0, flutter_reactive_button >=1.1.0 is incompatible with bloc ^2.0.0.

So, because min_support depends on both bloc ^2.0.0 and flutter_reactive_button ^1.1.0, version solving failed.

@rdev-software
Copy link

rdev-software commented Feb 28, 2020 via email

@5stones1sling
Copy link
Author

Here is how I got around it, based on @rdev-software's suggestion. Provide it a rect for sharePositionOrigin.

ShareExtend.share(backup.path, "file", sharePositionOrigin: Rect.fromCenter(center: Offset.fromDirection(100), width: 200, height: 200), sharePanelTitle: AppLocalizations.of(context).translate("backup"));

@rdev-software
Copy link

Except @kennedykok that is incorrect. As you should provide origin from your "button" or label or any widget. So I said that you can use that tutorial.

So in essence you will provide GlobalKey to your widget -> then pass its context to class -> get Rect -> provide rect to ShareExtend plugin

@rignaneseleo
Copy link

So what is the final solution to this?

@zhouteng0217
Copy link
Owner

@rignaneseleo You can add sharePositionOrigin param to work on the ipad. Just like below

 ShareExtend.share(path, "image",
           sharePositionOrigin: Rect.fromLTWH(0, 0, 100, 100));

And I had set a default popover point on the new version 1.1.7. You can try the new version and don't need sharePositionOrigin param.

@yizhangxyz
Copy link

@rignaneseleo You can add sharePositionOrigin param to work on the ipad. Just like below

 ShareExtend.share(path, "image",
           sharePositionOrigin: Rect.fromLTWH(0, 0, 100, 100));

And I had set a default popover point on the new version 1.1.7. You can try the new version and don't need sharePositionOrigin param.

share_extend ^1.1.7 which doesn't match any versions, version solving failed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants