IapError.fromCode constructor

IapError.fromCode(
  1. String code, {
  2. String? hint,
  3. Object? originalError,
})

Creates an error from a code with default message.

Implementation

factory IapError.fromCode(String code,
    {String? hint, Object? originalError}) {
  return IapError(
    code: code,
    message: _defaultMessages[code] ?? 'An unknown error occurred',
    hint: hint ?? _defaultHints[code],
    originalError: originalError,
  );
}