CheckoutPage class
The CheckoutPage widget is a stateless widget resembling your typical checkout page and some typical option along with some helpful features such as built-in form validation and credit card icons that update based on the input provided. This is a UI widget only and holds no responsibility and makes no guarantee for transactions using this ui. Transaction security and integrity is the responsibility of the developer and what ever Third-party transaction api that developer is using. A great API to use is Stripe
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatelessWidget
- CheckoutPage
Constructors
-
CheckoutPage({Key? key, required List<
PriceItem> priceItems, required String payToName, bool displayNativePay = false, bool isApple = false, Function? onNativePay, bool displayCashPay = false, Function? onCashPay, required dynamic onCardPay(CardFormResults), bool displayEmail = true, bool lockEmail = false, String initEmail = '', String initPhone = '', String initBuyerName = '', List<String> ? countriesOverride, Function? onBack, GlobalKey<CardPayButtonState> ? payBtnKey, GlobalKey<FormState> ? formKey, double? cashPrice, bool displayTestData = false, }) -
The CheckoutPage widget is a stateless widget resembling your typical
checkout page and some typical option along with some helpful features
such as built-in form validation and credit card icons that update
based on the input provided.
This is a UI widget only and holds no responsibility and makes no guarantee
for transactions using this ui. Transaction security and integrity is
the responsibility of the developer and what ever Third-party transaction
api that developer is using. A great API to use is Stripe
const
Properties
- cashPrice → double?
-
If you are providing a cash option at a discount, provide its price
ex: 12.99
final
-
countriesOverride
→ List<
String> ? -
If you have a List of Countries that you would like to use to override the
currently provide list of 1, being 'United States', add the list here.
Warning: The credit card form does not currently adjust based on selected
country's needs to verify a card. This form may not work for all countries
final
- displayCashPay → bool
-
Should the cash option appear?
final
- displayEmail → bool
-
Should the email box be displayed?
final
- displayNativePay → bool
-
should you display native pay option?
final
- displayTestData → bool
-
If you would like to display test data during your development, a dataset
based on Stripe test data is provided. To use this date, simply mark this
true.
WARNING: Make sure to mark false for any release
final
-
Provide a footer to end the checkout page using any desired widget or
use our built-in CheckoutPageFooter
final
-
formKey
→ GlobalKey<
FormState> ? -
You will need to provide a general
FormState
key to control, validate and save the form data based on your needs.final - hashCode → int
-
The hash code for this object.
no setterinherited
- initBuyerName → String
-
Provide a name if you have it, to prefill the name field on the Credit
Card form
final
- initEmail → String
-
Provide an email if you have it, to prefill the email field on the Credit
Card form
final
- initPhone → String
-
Provide a phone number if you have it, to prefill the name field on the
Credit Card form
final
- isApple → bool
-
is this the user on an apple based platform?
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- lockEmail → bool
-
Should the email form field be locked? This should only be done if an
initEmail is provided
final
- onBack → Function?
-
If you would like to provide an integraded back button in the header, add
add the needed functionality here.
ex) onBack : ()=>Navigator.of(context).pop();
final
- onCardPay → dynamic Function(CardFormResults)
-
Provide a function that recieves CardFormResults as a parameter that is
to be trigger once the user completes the credit card form and presses
pay
final
- onCashPay → Function?
-
Provide a function that should trigger if the user presses the cash
option. Can be left null if Cash option is not to be displayed
final
- onNativePay → Function?
-
Provide a function that will be triggered once the user clicks on the
native button. Can be left null if native option is not to be displayed
final
-
payBtnKey
→ GlobalKey<
CardPayButtonState> ? -
If you would like to control the pay button state to display text or icons
based on the current stage of the payment process, you will need to
provide a
CardPayButtonState
key to update it.final - payToName → String
-
Provide the name of the vendor handling the transaction or recieving the
funds from the user during this transaction
final
-
priceItems
→ List<
PriceItem> -
The list of items with prices
PriceItem
's to be shown within the drop down banner on the checkout pagefinal - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
build(
BuildContext context) → Widget -
Describes the part of the user interface represented by this widget.
override
-
createElement(
) → StatelessElement -
Creates a StatelessElement to manage this widget's location in the tree.
inherited
-
debugDescribeChildren(
) → List< DiagnosticsNode> -
Returns a list of
DiagnosticsNode
objects describing this node's children.inherited -
debugFillProperties(
DiagnosticPropertiesBuilder properties) → void -
Add additional properties associated with the node.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toDiagnosticsNode(
{String? name, DiagnosticsTreeStyle? style}) → DiagnosticsNode -
Returns a debug representation of the object that is used by debugging
tools and by DiagnosticsNode.toStringDeep.
inherited
-
toString(
{DiagnosticLevel minLevel = DiagnosticLevel.info}) → String -
A string representation of this object.
inherited
-
toStringDeep(
{String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug}) → String -
Returns a string representation of this node and its descendants.
inherited
-
toStringShallow(
{String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) → String -
Returns a one-line detailed description of the object.
inherited
-
toStringShort(
) → String -
A short, textual description of this widget.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited