2017-07-09 29 views
0

我正在使用Flutter轉換一些舊的Swift應用程序。我如何使用撲翼創建一個「分享」按鈕,至少獲取Facebook和Twitter並使其跨iOS和Android版本的平臺。這裏是斯威夫特的代碼,我使用....使用Flutter爲iOS和Android創建共享按鈕?

let activityViewController : UIActivityViewController = UIActivityViewController(
      activityItems: [firstActivityItem, secondActivityItem, image], applicationActivities: nil) 

     // This lines is for the popover you need to show in iPad 
     activityViewController.popoverPresentationController?.sourceView = (self.shareBTN) 

     // This line remove the arrow of the popover to show in iPad 
     activityViewController.popoverPresentationController?.permittedArrowDirections = UIPopoverArrowDirection() 
     activityViewController.popoverPresentationController?.sourceRect = CGRect(x: 150, y: 150, width: 0, height: 0) 
     actInd.stopAnimating() 
     self.present(activityViewController, animated: true, completion: nil) 

回答

1

退房的Flutter share plugin - 它可能有你需要的。

+0

Thanks @CollinJackson我可以假設這些插件的工作類似於CocoaControls.com,即除Flutter插件外的自定義庫嗎?我會確保給頁面添加書籤! –

+0

我對CocoaControls並不熟悉,但flutter/plugins是圍繞本地API和SDK的開放源碼包裝庫,因此您可以在撲翼應用中輕鬆使用它們。它由Flutter團隊維護;始終歡迎捐款! –