IvorypayFlutter class

The above code is defining a constructor for a class called IvorypayFlutter. The constructor takes in several parameters including a required BuildContext object, a boolean isDev flag with a default value of true, a required data object, and optional callback functions for onError, onSuccess, and onLoading

Constructors

IvorypayFlutter({required BuildContext context, bool isDev = true, required InitiateIvorypayTransaction data, required dynamic onError(bool, Object)?, required dynamic onSuccess(VerifyTransactionRes)?, required dynamic onLoading(bool)?})

Properties

context BuildContext
The above code is declaring a final variable named [context[ of type [BuildContext[. It is not doing anything else as it is just a declaration and not an executable code.
final
data InitiateIvorypayTransaction
The above code is declaring a final variable named "data" of type "InitiateIvorypayTransaction". The type "InitiateIvorypayTransaction" is likely a custom class or data structure defined elsewhere in the code.
final
hashCode int
The hash code for this object.
no setterinherited
isDev bool
These are instance variables of the [IvorypayFlutter[ class in Dart.
final
isLoading ValueNotifier<bool>
The above code is declaring a [ValueNotifier[ object named [isLoading[ with a boolean value of [false[. [ValueNotifier[ is a class in Dart that provides a way to listen to changes to a value and notify listeners when the value changes. In this case, [isLoading[ is likely being used to track whether a certain process or operation is currently in progress (i.e. [isLoading[ is [true[ when the process is running and [false[ when it is not).
getter/setter pair
onError → dynamic Function(bool, Object)?
[final Function(bool, Object)? onError;[ is a nullable instance variable of the [IvorypayFlutter[ class in Dart. It represents a function that takes in two arguments: a boolean value and an object. The [?[ indicates that this variable can be null, meaning it may or may not have a function assigned to it. This function is called when an error occurs during the execution of the [run()[ or [verifyStatus()[ functions. The boolean value indicates whether the error is critical or not, and the object contains information about the error.
final
onLoading → dynamic Function(bool)?
[final Function(bool)? onLoading;[ is a nullable instance variable of the [IvorypayFlutter[ class in Dart. It represents a function that takes in a boolean value as an argument and returns nothing ([void[). The [?[ indicates that this variable can be null, meaning it may or may not have a function assigned to it. This function is called when the [run()[ function is executed and the loading state changes. It allows the user of the [IvorypayFlutter[ class to define their own custom behavior when the loading state changes.
final
onSuccess → dynamic Function(VerifyTransactionRes)?
[final Function(VerifyTransactionRes)? onSuccess;[ is a nullable instance variable of the [IvorypayFlutter[ class in Dart. It represents a function that takes in a [VerifyTransactionRes[ object as an argument and returns nothing ([void[). The [?[ indicates that this variable can be null, meaning it may or may not have a function assigned to it. This function is called when the [verifyStatus()[ function is successful and returns a [VerifyTransactionRes[ object. It allows the user of the [IvorypayFlutter[ class to define their own custom behavior when a transaction is successfully verified.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
timer Timer?
The above code is declaring a nullable variable [timer[ of type [Timer[ in Dart. The [Timer[ class is used to create a timer that runs a callback function after a specified duration. The [?[ after the type [Timer[ indicates that the variable can be null.
getter/setter pair

Methods

closeAfterTimer(BuildContext context) → void
This function sets a timer for 10 seconds and closes the current screen while showing a snackbar with an error message.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
run() Future<String>
This function sends a POST request to a server with specific data and returns a payment link if successful.
toString() String
A string representation of this object.
inherited
verifyStatus(String ref, String msg) Future<String?>
This function verifies the status of a transaction and returns the status string.

Operators

operator ==(Object other) bool
The equality operator.
inherited