MasriviView class
A view that displays Masrivi payment in a WebView.
Loads the Masrivi pay URL and listens for navigation to success/decline URLs. When the URL contains "/success", onPaymentSuccess is invoked. When the URL contains "/decline", onPaymentDeclined is invoked and the view goes back.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatelessWidget
- MasriviView
Constructors
-
MasriviView({Key? key, required String publishableApiKey, required String transactionId, required String configurationId, FutureOr<
void> onPaymentSuccess(bool isSuccess)?, VoidCallback? onBackPress, VoidCallback? onPaymentDeclined, MasriviWebViewPresentation presentation = MasriviWebViewPresentation.fullPage, String? phoneNumber}) -
Creates a new MasriviView instance.
const
Properties
- configurationId → String
-
The configuration ID (payment method ID) from
PaymentMethod.id.final - hashCode → int
-
The hash code for this object.
no setterinherited
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- onBackPress → VoidCallback?
-
Callback when the back button is pressed.
final
- onPaymentDeclined → VoidCallback?
-
Callback when payment is declined (URL contains "/decline").
Called after going back to the payment method list. Use to show an error message.
final
-
onPaymentSuccess
→ FutureOr<
void> Function(bool isSuccess)? -
Callback when payment is successful (URL contains "/success").
final
- phoneNumber → String?
-
Phone number to prefill in the Masrivi page when a matching input is found.
final
- presentation → MasriviWebViewPresentation
-
Display as a full page or bottom-sheet content.
final
- publishableApiKey → String
-
The API key for authenticating the payment.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- transactionId → String
-
The transaction ID for the payment.
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