requestConsentInfoUpdate method

Future<ConsentInformation> requestConsentInfoUpdate([
  1. ConsentRequestParameters? parameters
])

Updates the ConsentInformation for the current user.

Callers should handle RequestExceptions.

Implementation

Future<ConsentInformation> requestConsentInfoUpdate([
  ConsentRequestParameters? parameters,
]) async {
  try {
    return await _channel
        .invokeMethod<Map>('requestConsentInfoUpdate', parameters?.toJson())
        .then((it) => it!.cast<String, String>())
        .then(_parseConsentInformation);
  } on PlatformException catch (exception) {
    if (exception.code == _unknownErrorCode) {
      rethrow;
    }

    final code = _enumFromString(RequestErrorCode.values, exception.code);
    if (code == null) {
      rethrow;
    }

    throw RequestException(
      message: exception.message!,
      code: code,
      originalException: exception,
    );
  }
}