bankTransferTypeFromJson function

BankTransferType bankTransferTypeFromJson(
  1. Object? bankTransferType, [
  2. BankTransferType? defaultValue
])

Implementation

enums.BankTransferType bankTransferTypeFromJson(
  Object? bankTransferType, [
  enums.BankTransferType? defaultValue,
]) {
  if (bankTransferType is String) {
    return enums.$BankTransferTypeMap.entries
        .firstWhere(
            (element) =>
                element.value.toLowerCase() == bankTransferType.toLowerCase(),
            orElse: () => const MapEntry(
                enums.BankTransferType.swaggerGeneratedUnknown, ''))
        .key;
  }

  final parsedResult = defaultValue == null
      ? null
      : enums.$BankTransferTypeMap.entries
          .firstWhereOrNull((element) => element.value == defaultValue)
          ?.key;

  return parsedResult ??
      defaultValue ??
      enums.BankTransferType.swaggerGeneratedUnknown;
}