MoosylPaymentMethods class
Standalone payment method picker that can be embedded in custom checkout UI.
Use controller to trigger MoosylPaymentMethodsController.continuePayment from a button owned by your screen.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatelessWidget
- MoosylPaymentMethods
Constructors
-
MoosylPaymentMethods({Key? key, required String publishableApiKey, String? transactionId, double amountToPay = 0.0, double tax = 0.0, double? totalAmount, String? selectedMethodId, ValueChanged<
ConfigurationListDataInner> ? onSelectMethod, FutureOr<void> onPaymentSuccess(bool isSuccess)?, ValueChanged<Object> ? onPaymentError, ValueChanged<bool> ? onContinueLoadingChange, MoosylPaymentMethodsController? controller, Color? primaryColor, MoosylPaymentMethodBuilder? renderMethod, Widget? loadingComponent, MoosylPaymentMethodsLoadingBuilder? loadingBuilder, bool showDefaultTitle = true, bool isMasriviInBottomSheet = true, MasriviWebViewPresentation masriviPresentation = MasriviWebViewPresentation.fullPage, String? masriviPhoneNumber, double masriviBottomSheetHeight = 0.88}) -
Creates a reusable payment method picker.
const
Properties
- amountToPay → double
-
Amount to pay, used for validation when continuing.
final
- controller → MoosylPaymentMethodsController?
-
Controller used by host UI to continue payment.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- isMasriviInBottomSheet → bool
-
When true, Masrivi opens inside a bottom sheet from custom platform UIs.
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- loadingBuilder → MoosylPaymentMethodsLoadingBuilder?
-
Custom loading builder shown while payment methods are loading.
final
- loadingComponent → Widget?
-
Custom loading widget shown while payment methods are loading.
final
- masriviBottomSheetHeight → double
-
Height factor used when Masrivi is rendered as bottom-sheet content.
final
- masriviPhoneNumber → String?
-
Optional phone number to prefill when the selected method opens Masrivi.
final
- masriviPresentation → MasriviWebViewPresentation
-
How Masrivi should be presented when this picker opens the WebView.
final
-
onContinueLoadingChange
→ ValueChanged<
bool> ? -
Called when continuePayment starts or finishes.
final
-
onPaymentError
→ ValueChanged<
Object> ? -
Called when continuing fails.
final
-
onPaymentSuccess
→ FutureOr<
void> Function(bool isSuccess)? -
Called when payment succeeds.
final
-
onSelectMethod
→ ValueChanged<
ConfigurationListDataInner> ? -
Called whenever a method is selected.
final
- primaryColor → Color?
-
Accent color for the default rows and dialogs.
final
- publishableApiKey → String
-
Publishable API key used to load payment methods.
final
- renderMethod → MoosylPaymentMethodBuilder?
-
Custom row builder. Call
data.onSelect()inside the returned widget.final - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- selectedMethodId → String?
-
Controlled selected method id.
final
- showDefaultTitle → bool
-
Whether the default UI should include the section title.
final
- tax → double
-
Tax amount, used with amountToPay when totalAmount is not supplied.
final
- totalAmount → double?
-
Total expected amount. Defaults to amountToPay + tax.
final
- transactionId → String?
-
Transaction id used by MoosylPaymentMethodsController.continuePayment.
final
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, int wrapWidth = 65}) → 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