简体   繁体   English

有谁知道如何使用颤振创建贝宝捐赠按钮?

[英]Does anyone know how to create a paypal donate button using flutter?

我正在尝试使用 Flutter 创建一个具有 Paypal 捐赠按钮的应用程序,但 Paypal 只提供捐赠按钮的 html 代码,所以有人知道如何使用 Flutter 创建吗?

You could create your own button with a Container - decoration - radius , a background color and so on (or just an image with a FlatButton on top), but that is not recommended.您可以使用Container - decoration - radius 、背景颜色等(或只是顶部带有FlatButton的图像)创建自己的按钮,但不建议这样做。 App Store Guidelines prohibit any third party payment solutions. App Store Guidelines禁止任何第三方支付解决方案。 So you could only use it in the Play Store with Android Apps.所以你只能在 Play 商店和 Android 应用程序中使用它。

Now what you can do is use In-App Purchases to handle such donations.现在您可以做的是使用应用内购买来处理此类捐赠。 There is an easy package here .有一个简单的包在这里

Set everything like in the example and just call this to start a purchase flow:像示例中一样设置所有内容,然后调用它以启动购买流程:

List<IAPProduct> _productIds = [];
...
@override initState() { 
    super.initState(); 
    init(); 
} 

init() async { 
    IAPResponse response = await FlutterIap.fetchProducts(["com.example.testiap"]); 
    List<IAPProduct> productIds = response.products; 
    if (!mounted) 
        return; 
    setState(() {
        _productIds = productIds; 
    }); 
}

Then call this, anywhere you like:然后在你喜欢的任何地方调用它:

FlutterIap.buy(_productIds.first.productIdentifier);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 有谁知道如何使用 flutter 实现带有类似于 instagram 的标签的搜索栏? - Does anyone know how to implement a search bar with tabs like that similar to instagram using flutter? 有谁知道是否可以扩展 flutter 小部件? - Does anyone know if it is possible to extend a flutter widget? 有谁知道如何在 Flutter 上让图像跟随这样的设备运动? - Does anyone know how to make images follow device movements like this, on Flutter? 有谁知道如何消除这个奇怪的阴影? - Does anyone know how to remove this weird shaddow? 我想使用颤振从设备录制内部声音。如果有人知道如何使用颤振进行此操作,请分享 - I want to record an internal sound from a device using flutter.Please share if anyone know how to do this using flutter 如何使用while或for来创建按钮? - How to create button using while or for in flutter? 如何使用 flutter 在单击按钮时创建覆盖 - How to Create an overlay on click of a button by using flutter 如何使用 flutter 创建一个原始按钮 - How to create a button raw using flutter 在 flutter 运行期间出现错误。 错误有一些 pod 文件。 有谁知道如何解决? - I'm getting error during flutter run. Error has something to pod file. Does anyone know how to resolve? 任何人都知道如何使用 flutter 中的 ml 套件检测数字 - anyone know how to detect numbers with ml kit in flutter
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM