PaymentElementLayout class abstract
Specify the layout for the Payment Element. If you only pass a layout type ('accordion' or ‘tabs’) without any additional parameters, t he Payment Element renders using that layout and the default values associated with it.
An PaymentElementLayout can also be passed to specify the layout with additional configuration.
- Available extensions
- Annotations
-
- @freezed
Constructors
- PaymentElementLayout({required PaymentElementLayoutType type, bool? defaultCollapsed, bool? radios, bool? spacedAccordionItems, int? visibleAccordionItemsCount})
-
constfactory
-
PaymentElementLayout.fromJson(Map<
String, dynamic> json) -
factory
Properties
-
copyWith
→ $PaymentElementLayoutCopyWith<
PaymentElementLayout> -
Create a copy of PaymentElementLayout
with the given fields replaced by the non-null parameter values.
no setterinherited
- defaultCollapsed → bool?
-
Controls if the Payment Element renders in a collapsed state
(where no payment method is selected by default).
When you leave this `undefined``,
Stripe renders the experience that it determines
will have the best conversion.
no setterinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- radios → bool?
-
Renders each Payment Method with a radio input next to its logo.
The radios visually indicate the current selection of the Payment
Element.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- spacedAccordionItems → bool?
-
When true, the Payment Methods renders as standalone buttons
with space in between them.
This property is only applicable to the accordion layout.
no setterinherited
- type → PaymentElementLayoutType
-
Defines the layout to render the Payment Element.
no setterinherited
- visibleAccordionItemsCount → int?
-
Sets the max number of Payment Methods visible before using the "More"
button to hide additional Payment Methods. Set this value to 0 to
disable the "More" button and render all available Payment Methods.
Default is 5. This property is only applicable to the accordion layout.
no setterinherited
Methods
-
map<
TResult extends Object?> (TResult $default(_PaymentElementLayout value)) → TResult -
Available on PaymentElementLayout, provided by the PaymentElementLayoutPatterns extension
Aswitch
-like method, using callbacks. -
mapOrNull<
TResult extends Object?> (TResult? $default(_PaymentElementLayout value)?) → TResult? -
Available on PaymentElementLayout, provided by the PaymentElementLayoutPatterns extension
A variant ofmap
that fallback to returningnull
. -
maybeMap<
TResult extends Object?> (TResult $default(_PaymentElementLayout value)?, {required TResult orElse()}) → TResult -
Available on PaymentElementLayout, provided by the PaymentElementLayoutPatterns extension
A variant ofmap
that fallback to returningorElse
. -
maybeWhen<
TResult extends Object?> (TResult $default(PaymentElementLayoutType type, bool? defaultCollapsed, bool? radios, bool? spacedAccordionItems, int? visibleAccordionItemsCount)?, {required TResult orElse()}) → TResult -
Available on PaymentElementLayout, provided by the PaymentElementLayoutPatterns extension
A variant ofwhen
that fallback to anorElse
callback. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, dynamic> -
Serializes this PaymentElementLayout to a JSON map.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
when<
TResult extends Object?> (TResult $default(PaymentElementLayoutType type, bool? defaultCollapsed, bool? radios, bool? spacedAccordionItems, int? visibleAccordionItemsCount)) → TResult -
Available on PaymentElementLayout, provided by the PaymentElementLayoutPatterns extension
Aswitch
-like method, using callbacks. -
whenOrNull<
TResult extends Object?> (TResult? $default(PaymentElementLayoutType type, bool? defaultCollapsed, bool? radios, bool? spacedAccordionItems, int? visibleAccordionItemsCount)?) → TResult? -
Available on PaymentElementLayout, provided by the PaymentElementLayoutPatterns extension
A variant ofwhen
that fallback to returningnull
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Constants
- accordion → const PaymentElementLayout
- tabs → const PaymentElementLayout