dispose method

void dispose(
  1. FastpayPaymentResponse? response
)

Implementation

void dispose(FastpayPaymentResponse? response){
  _start = (_fastpayPaymentRequest?.isProduction == true) ? (2 * 60) : (5 * 50);
  debugPrint('Canceling timer in FastpayFlutterSdk');
  _timer?.cancel();
  _timer = null; // Prevent reuse
  if (_context != null && Navigator.canPop(_context!)) {
    try {
      if (_isTermsAndConditionPage) {
        Navigator.of(_context!).pop();
      }
      Navigator.of(_context!).pop();
    } catch (e) {
      debugPrint('Error during dispose navigation: $e');
    }
  }
  _context = null; // Clear context to prevent further navigation
}