Label<T extends Enum> class
Generic label wrapper that combines an enum label with an optional custom label string.
When label is a custom enum value (e.g., PhoneLabel.custom, EmailLabel.custom), customLabel must be provided.
When creating or updating contacts, unsupported labels on a platform are automatically converted to the custom enum value with the original label name preserved in customLabel.
On iOS/macOS, Apple's built-in labels without an enum value (e.g. most relation labels)
are read as customLabel in Apple's raw _$!<ElderBrother>!$_ form, so that saving the
contact writes them back unchanged. Strip the _$!< and >!$_ markers to display them.
Properties
- customLabel → String?
-
Custom label string used when label is a custom enum value (e.g., PhoneLabel.custom).
final
- hashCode → int
-
The hash code for this object.
no setteroverride
- label → T
-
The standard label type (e.g., PhoneLabel.mobile, EmailLabel.work).
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
copyWith(
{T? label, String? customLabel}) → Label< T> -
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