serializeEventToDo method

String serializeEventToDo()

Implementation

String serializeEventToDo() {
  var out = StringBuffer();
  if (location != null) {
    out.writecrlf('LOCATION:${escapeValue(location!)}');
  }
  if (lat != null && lng != null) {
    out.writecrlf('GEO:$lat;$lng');
  }
  if (resources != null) {
    out.writecrlf('RESOURCES:${resources!.map(escapeValue).join(',')}');
  }
  if (priority != null) {
    priority = (priority! >= 0 && priority! <= 9) ? priority : 0;
    out.writecrlf('PRIORITY:$priority');
  }
  if (alarm != null) out.write(alarm!.serialize());

  return out.toString();
}