ContactEvent class
Represents a contact event (birthday, anniversary, etc.)
- Annotations
Constructors
- ContactEvent({required int month, required int day, int? year, EventLabel label = EventLabel.other, String customLabel = ''})
-
Creates a new ContactEvent with required month and day
const
- ContactEvent.anniversary({required int month, required int day, int? year})
-
Creates an anniversary event
factory
- ContactEvent.birthday({required int month, required int day, int? year})
-
Creates a birthday event
factory
- ContactEvent.custom({required int month, required int day, required String customLabel, int? year})
-
Creates a custom event
factory
-
ContactEvent.fromJson(Map<
String, dynamic> json) -
Creates an event from a JSON map
factory
Properties
- customLabel → String
-
Custom label if label is EventLabel.custom
final
- day → int
-
The day of the event (1-31)
final
- displayLabel → String
-
Returns the display name for the event
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- hasYear → bool
-
Returns true if this event has a year specified
no setter
- label → EventLabel
-
The label for this event
final
- month → int
-
The month of the event (1-12)
final
-
props
→ List<
Object?> -
The list of properties that will be used to determine whether
two instances are equal.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- stringify → bool?
-
If set to
true, thetoStringmethod will be overridden to output this instance'sprops.no setterinherited - year → int?
-
The year of the event (optional)
final
Methods
-
copyWith(
{int? month, int? day, int? year, EventLabel? label, String? customLabel}) → ContactEvent - Copy constructor
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toDateTime(
[int? fallbackYear]) → DateTime - Returns a DateTime object for this event in the given year If no year is specified, uses the provided year or current year
-
toJson(
) → Map< String, dynamic> - Converts this event to a JSON map
-
toString(
) → String - A string representation of this object.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited