TeadsAd constructor

TeadsAd(
  1. String requestIdentifier
)

Implementation

TeadsAd(this.requestIdentifier) {
  channel.setMethodCallHandler((call) async {
    switch (call.method) {
      case "didCatchError":
        try {
          final String errorLocalizedDescription = call.arguments[1];
          FlutterError error = FlutterError(errorLocalizedDescription);
          _delegate?.didCatchError(this, error);
        } on StateError {
          throw Exception(badArgumentsErrorMessage);
        }
        break;
      case "didClose":
        _delegate?.didClose(this);
        break;
      case "didRecordImpression":
        _delegate?.didRecordImpression(this);
        break;
      case "didRecordClick":
        _delegate?.didRecordClick(this);
        break;
      case "didExpandedToFullscreen":
        _delegate?.didExpandedToFullscreen(this);
        break;
      case "didCollapsedFromFullscreen":
        _delegate?.didCollapsedFromFullscreen(this);
        break;
      case "adStartPlayingAudio":
        _playbackDelegate?.adStartPlayingAudio(this);
        break;
      case "adStopPlayingAudio":
        _playbackDelegate?.adStopPlayingAudio(this);
        break;
      case "didPlay":
        _playbackDelegate?.didPlay(this);
        break;
      case "didPause":
        _playbackDelegate?.didPause(this);
        break;
      case "didComplete":
        _playbackDelegate?.didComplete(this);
        break;
      default:
        break;
    }
  });
}