setListener method

Future<void> setListener({
  1. void onConsentFormDismissed(
    1. String errorDescription
    )?,
  2. void onConsentFormLoadFailure(
    1. String errorDescription
    )?,
  3. void onConsentFormLoadSuccess()?,
  4. void onConsentInfoUpdateFailure(
    1. String errorDescription
    )?,
  5. void onConsentInfoUpdateSuccess()?,
})

Implementation

Future<void> setListener({
  void Function(String errorDescription)? onConsentFormDismissed,
  void Function(String errorDescription)? onConsentFormLoadFailure,
  void Function()? onConsentFormLoadSuccess,
  void Function(String errorDescription)? onConsentInfoUpdateFailure,
  void Function()? onConsentInfoUpdateSuccess,
}) async {
  if(onConsentFormDismissed != null){
    this.onConsentFormDismissed = onConsentFormDismissed;
  }
  if(onConsentFormLoadFailure != null){
    this.onConsentFormLoadFailure = onConsentFormLoadFailure;
  }
  if(onConsentFormLoadSuccess != null){
    this.onConsentFormLoadSuccess = onConsentFormLoadSuccess;
  }
  if(onConsentInfoUpdateFailure != null){
    this.onConsentInfoUpdateFailure = onConsentInfoUpdateFailure;
  }
  if(onConsentInfoUpdateSuccess != null){
    this.onConsentInfoUpdateSuccess = onConsentInfoUpdateSuccess;
  }

  _platform.setMethodCallHandler(_handleMethod);
  return await _platform.invokeMethod('setListener');
}