debounceClose method

void debounceClose()

Implementation

void debounceClose() {
  print("debounceClose : ${this.widget.isWidget}");

  if(this.widget.isWidget == true) {
    // this.widget.onCloseWidget!();
    widget.closeController.bootpayClose(this.widget.onCloseWidget);
  } else {
    // Non-widget mode: wrap onClose to also pop the navigator
    widget.closeController.bootpayClose(() {
      // Call user's onClose callback first
      if(this.widget.onClose != null) {
        this.widget.onClose!();
      }
      // Then pop the navigator to dismiss Bootpay UI
      if(context.mounted) {
        Navigator.of(context).pop();
      }
    });
  }
  // widget.paymentResult = BootpayPaymentResult.NONE;
  // widget.closeController.bootpayClose(this.widget.onClose);
}