CalendarParsedResult constructor

CalendarParsedResult(
  1. String? summary,
  2. String? startString,
  3. String? endString,
  4. String? durationString,
  5. String? location,
  6. String? organizer,
  7. List<String>? _attendees,
  8. String? description,
  9. double? latitude,
  10. double? longitude,
)

Implementation

CalendarParsedResult(
  this.summary,
  String? startString,
  String? endString,
  String? durationString,
  this.location,
  this.organizer,
  this._attendees,
  this.description,
  this.latitude,
  this.longitude,
) : super(ParsedResultType.CALENDAR) {
  try {
    _start = _parseDate(startString);
  } on ParseException catch (_) {
    throw ArgumentError(_.toString());
  }

  if (endString == null) {
    final durationMS = _parseDurationMS(durationString);
    _end = durationMS < 0 ? -1 : _start + durationMS;
  } else {
    try {
      _end = _parseDate(endString);
    } on ParseException catch (_) {
      throw ArgumentError(_.toString());
    }
  }

  _startAllDay = startString != null && startString.length == 8;
  _endAllDay = endString != null && endString.length == 8;
}