dateTimeRangeFromString function
END SERIALIZATION HELPERS DESERIALIZATION HELPERS
Implementation
/// DESERIALIZATION HELPERS
DateTimeRange? dateTimeRangeFromString(String dateTimeRangeStr) {
final pieces = dateTimeRangeStr.split('|');
if (pieces.length != 2) {
return null;
}
return DateTimeRange(
start: DateTime.fromMillisecondsSinceEpoch(int.parse(pieces.first)),
end: DateTime.fromMillisecondsSinceEpoch(int.parse(pieces.last)),
);
}