zhouteng0217 / ShareExtend

调用系统分享的Flutter组件,支持分享文本,图片,视频和文件
MIT License
176 stars 53 forks source link

Does not work on iPad #24

Open fwmd7 opened 4 years ago

fwmd7 commented 4 years ago

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 commented 4 years ago

Same here

rdev-software commented 4 years ago

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/

fwmd7 commented 4 years ago

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 commented 4 years ago

That wasnt what ive suggested

On Fri, 28 Feb 2020 at 4:36 PM, kennedykok notifications@github.com wrote:

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.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/zhouteng0217/ShareExtend/issues/24?email_source=notifications&email_token=AL73D4IDQTJ2ZPUSBKMKVDTRFCBFBA5CNFSM4K4UUMM2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOENG3UEA#issuecomment-592296464, or unsubscribe https://github.com/notifications/unsubscribe-auth/AL73D4NMHKJDOBG2V7NTY2TRFCBFBANCNFSM4K4UUMMQ .

fwmd7 commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

So what is the final solution to this?

zhouteng0217 commented 4 years ago

@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 commented 4 years ago

@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.