Contact class

Unified contact model representing a contact across all platforms.

id is generated automatically by the system and is read-only. displayName is computed automatically from name components by the platform and is read-only.

Property lists (phones, emails, addresses, etc.) contain property objects, each with a label (e.g., home, work, mobile) indicating its type.

Platform limitations:

metadata is auto-populated when fetching and required when updating. Never edit manually.

Constructors

Contact({String? id, String? displayName, Photo? photo, Name? name, List<Phone> phones = const [], List<Email> emails = const [], List<Address> addresses = const [], List<Organization> organizations = const [], List<Website> websites = const [], List<SocialMedia> socialMedias = const [], List<Event> events = const [], List<Relation> relations = const [], List<Note> notes = const [], AndroidData? android, ContactMetadata? metadata})
const

Properties

addresses List<Address>
Postal addresses.
final
android AndroidData?
Android-specific fields.
final
displayName String?
Auto-generated display name (read-only, system-generated).
final
emails List<Email>
Email addresses.
final
events List<Event>
Events (e.g., birthdays, anniversaries).
final
hashCode int
The hash code for this object.
no setteroverride
id String?
Stable identifier for the unified contact.
final
metadata ContactMetadata?
Metadata about fetched properties (used internally, never edit manually).
final
name Name?
Structured name.
final
notes List<Note>
Notes.
final
organizations List<Organization>
Organizations.
final
phones List<Phone>
Phone numbers.
final
photo Photo?
Contact photo.
final
relations List<Relation>
Relationships to other people.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
socialMedias List<SocialMedia>
Social media profiles.
final
websites List<Website>
Website URLs.
final

Methods

copyWith({String? id, String? displayName, Photo? photo, Name? name, List<Phone>? phones, List<Email>? emails, List<Address>? addresses, List<Organization>? organizations, List<Website>? websites, List<SocialMedia>? socialMedias, List<Event>? events, List<Relation>? relations, List<Note>? notes, AndroidData? android, ContactMetadata? metadata, bool clearPhoto = false}) Contact
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Map<String, dynamic>
toString() String
A string representation of this object.
override

Operators

operator ==(Object other) bool
The equality operator.
override

Static Methods

fromJson(Map json) Contact