CalendarEvent class
Represents an immutable calendar event associated with a Bikram Sambat date.
Designed to be independent of UI, supporting multiple events per day, custom metadata, and optional presentation styling (e.g. color hex/RGB or icon identifiers).
- Implemented types
- Annotations
Constructors
-
CalendarEvent({required String id, required String title, required NepaliDate date, String? description, CalendarEventType type = CalendarEventType.general, int? colorValue, String? iconName, Map<
String, dynamic> ? metadata}) -
const
-
CalendarEvent.from({required String id, required String title, required dynamic date, String? description, CalendarEventType type = CalendarEventType.general, int? colorValue, String? iconName, Map<
String, dynamic> ? metadata}) -
Factory constructor supporting NepaliDate, NepaliDateTime, or DateTime.
factory
Properties
- colorValue → int?
-
Optional 32-bit ARGB color value (e.g. 0xFF4CAF50) for pure Dart styling compatibility.
final
- date → NepaliDate
-
The date of the event in the Bikram Sambat calendar.
final
- dateTime → NepaliDateTime
-
The date as a NepaliDateTime at 00:00:00.
no setter
- description → String?
-
Optional detailed description.
final
- hashCode → int
-
The hash code for this object.
no setteroverride
- iconName → String?
-
Optional icon identifier or name (e.g. 'work', 'birthday', 'event').
final
- id → String
-
Unique identifier for the event.
final
-
metadata
→ Map<
String, dynamic> ? -
Arbitrary user or system metadata (e.g. database ID, JSON payload, custom flags).
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- title → String
-
Title or short summary of the event.
final
- type → CalendarEventType
-
Category / event type classification.
final
Methods
-
compareTo(
CalendarEvent other) → int -
Compares this object to another object.
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override