Last active
August 31, 2021 14:24
-
-
Save hassanannajjar/97523e97cb0a8eabfe7bb19ba86c4858 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
import 'package:pay/pay.dart'; | |
class MyHomePage extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return Scaffold( | |
appBar: AppBar( | |
title: Text('Apple Pay Example'), | |
), | |
body: Center( | |
child: Column( | |
mainAxisAlignment: MainAxisAlignment.center, | |
children: <Widget>[ | |
ApplePayButton( | |
paymentConfigurationAsset: 'applepay.json', | |
paymentItems: _paymentItems, | |
style: ApplePayButtonStyle.black, | |
type: ApplePayButtonType.buy, | |
width: 200, | |
height: 50, | |
margin: const EdgeInsets.only(top: 15.0), | |
onPaymentResult: (value) { | |
print(value); | |
}, | |
onError: (error) { | |
print(error); | |
}, | |
loadingIndicator: const Center( | |
child: CircularProgressIndicator(), | |
), | |
), | |
], | |
), | |
), | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment