setAdResponse method

void setAdResponse(
  1. AdResponse response
)

Implementation

void setAdResponse(AdResponse response) {
  if(mounted) {
    if (response.status == 1) {
      setState(() {
        adResponse = response;
        if(widget.onAdLoaded != null) {
          widget.onAdLoaded!();
        }
      });
    } else {
      adResponse = null;
      if(widget.onAdFailedToLoad != null) {
        widget.onAdFailedToLoad!();
      }
    }
    startTimer();
  }else{
    if(widget.onAdFailedToLoad != null) {
      widget.onAdFailedToLoad!();
    }
  }
}