open method

Future<void> open(
  1. BuildContext context, {
  2. dynamic onSuccess(
    1. dynamic result
    )?,
  3. dynamic onClose(
    1. dynamic close
    )?,
  4. dynamic onError(
    1. dynamic error
    )?,
})

Implementation

Future<void> open(BuildContext context,
    {Function(dynamic result)? onSuccess,
    Function(dynamic close)? onClose,
    Function(dynamic error)? onError}) async {
  await Navigator.push(
    context,
    MaterialPageRoute(
      builder: (context) => WebviewScreen(
        appId: appId,
        publicKey: publicKey,
        type: type,
        userData: userData,
        metaData: metaData,
        govData: govData,
        govId: govId,
        config: config,
        amount: amount,
        referenceId: referenceId,
        success: (result) {
          onSuccess!(result);
        },
        close: (close) {
          onClose!(close);
        },
        error: (error) {
          onError!(error);
        },
      ),
    ),
  );
}