A Widget representing a checkout screen that accepts native and credit card payments along with a button for cash payments if you system has 'in person' payments. This is a UI only widget and is meant to compliment whatever third party transaction api system you are using.
pubspec.yaml of your flutter project, add the following dependency:
Import it to each file you use it in:
This example is a very basic checkout page.
/// Build a list of what the user is buying final List<PriceItem> _priceItems = [ PriceItem(name: 'Product A', quantity: 1, totalPriceCents: 5200), PriceItem(name: 'Product B', quantity: 2, totalPriceCents: 8599), PriceItem(name: 'Product C', quantity: 1, totalPriceCents: 2499), PriceItem(name: 'Delivery Charge', quantity: 1, totalPriceCents: 1599), ]; // build the checkout ui CheckoutPage( priceItems: _priceItems, payToName: 'Vendor Name Here', displayNativePay: true, onNativePay: () => print('Native Pay Clicked'), isApple: Platform.isIOS, onCardPay: (results) => print( 'Credit card form submitted with results: $results'), onBack: ()=> Navigator.of(context).pop(), );
- Is there a bug in the code? File an issue.
If a feature is missing (the Dart language is always evolving) or you'd like an easier or better way to do something, consider opening a pull request. You can always file an issue, but generally speaking feature requests will be on a best-effort basis.