phoneNumberTypeListFromJson function

List<PhoneNumberType> phoneNumberTypeListFromJson(
  1. List? phoneNumberType, [
  2. List<PhoneNumberType>? defaultValue
])

Implementation

List<enums.PhoneNumberType> phoneNumberTypeListFromJson(
  List? phoneNumberType, [
  List<enums.PhoneNumberType>? defaultValue,
]) {
  if (phoneNumberType == null) {
    return defaultValue ?? [];
  }

  return phoneNumberType
      .map((e) => phoneNumberTypeFromJson(e.toString()))
      .toList();
}