ContactInfo.fromNative constructor

ContactInfo.fromNative(
  1. Map data
)

Create a ContactInfo from native data.

Implementation

ContactInfo.fromNative(Map data)
    : addresses = List.unmodifiable(
        (data['addresses'] as List? ?? [])
            .cast<Map>()
            .map(Address.fromNative),
      ),
      emails = List.unmodifiable(
        (data['emails'] as List? ?? []).cast<Map>().map(Email.fromNative),
      ),
      name = toName(data['name'] as Map?),
      organization = data['organization'] as String?,
      phones = List.unmodifiable(
        (data['phones'] as List? ?? []).cast<Map>().map(Phone.fromNative),
      ),
      title = data['title'] as String?,
      urls = List.unmodifiable((data['urls'] as List? ?? []).cast<String>());