caldav library
A Dart client library for interacting with CalDAV servers.
This library provides a high-level API for CalDAV operations including:
- Server discovery (RFC 6764)
- Calendar CRUD operations
- Event CRUD operations with iCalendar support
- Timezone-aware datetime handling
Getting Started
import 'package:caldav/caldav.dart';
void main() async {
final client = await CalDavClient.connect(
baseUrl: 'https://caldav.example.com',
username: 'user@example.com',
password: 'password',
);
try {
final calendars = await client.getCalendars();
for (final cal in calendars) {
print('Calendar: ${cal.displayName}');
final events = await client.getEvents(cal);
for (final event in events) {
print(' Event: ${event.summary} at ${event.start}');
}
}
} finally {
client.close();
}
}
Classes
- CalDavClient
- CalDAV client for interacting with CalDAV servers
- Calendar
- Represents a CalDAV calendar collection
- CalendarEvent
- Represents a calendar event (VEVENT)
- DiscoveryResult
- Result of CalDAV endpoint discovery
Exceptions / Errors
- AuthenticationException
- Authentication failed (401)
- CalDavException
- Base exception for CalDAV operations
- ConflictException
- Conflict during update (409, 412)
- DiscoveryException
- Discovery failed
- NotFoundException
- Resource not found (404)
- ParseException
- XML parsing failed