toMap method
Converts to a map of time parts.
Returns: A Map<TimePart, int> with non-null parts.
Implementation
Map<TimePart, int> toMap() {
return {
if (hour != null) TimePart.hour: hour!,
if (minute != null) TimePart.minute: minute!,
if (second != null) TimePart.second: second!,
};
}