Account class

Contact account (e.g., Google account, iCloud account, local device account).

Contacts can belong to different accounts. On Android they're called accounts; on iOS/macOS they're called containers. Each account has an ID, display name, and type identifier (e.g., "com.google" for Google accounts).

Under the hood, contacts are stored as raw contacts within each account. When you have the same person in multiple accounts (e.g., "John Doe" in both your Google account and iCloud account), the system automatically links these raw contacts together into a unified contact. This unified contact appears as a single entry to users, combining data from all linked accounts. You can see which accounts contributed data via Contact.metadata.accounts.

Constructors

Account({required String id, required String name, required String type})
const

Properties

hashCode int
The hash code for this object.
no setteroverride
id String
Account identifier.
final
name String
Account display name (e.g., "user@gmail.com").
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
type String
Account type identifier (e.g., "com.google", "DeviceLocal").
final

Methods

copyWith({String? id, String? name, String? type}) Account
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) Account