initialSync method

Future<CalResponse> initialSync(
  1. String path, {
  2. int? depth,
  3. bool syncToken = true,
})

Get the display name and the ctag. This ctag works like a change id. Every time the ctag has changed, you know something in the calendar has changed too.

Implementation

Future<CalResponse> initialSync(String path, {int? depth, bool syncToken = true}) {
  var syncTokenTag = '\n<d:sync-token />';
  var body = '''
  <d:propfind xmlns:d="DAV:" xmlns:cs="http://calendarserver.org/ns/">
    <d:prop>
    <d:displayname />
    <cs:getctag />${syncToken ? syncTokenTag : ''}
    </d:prop>
  </d:propfind>
  ''';

  return propfind(path, body, depth: depth);
}