ical_serializer 0.0.1 copy "ical_serializer: ^0.0.1" to clipboard
ical_serializer: ^0.0.1 copied to clipboard

discontinuedreplaced by: ical
outdated

A library to generate/serialize iCalendar files

ical_serializer #

Dart package to generate iCalendar files.

https://en.wikipedia.org/wiki/ICalendar

Example #

import 'package:ical_serializer/ical_serializer.dart';
import 'dart:io';

main() async {
  ICalendar cal = ICalendar();
  cal.addElement(
    IEvent(
      uid: 'test@example.com',
      start: DateTime(2019, 3, 6),
      url: 'https://pub.dartlang.org/packages/srt_parser',
      status: IEventStatus.CONFIRMED,
      location: 'Heilbronn',
      description:
          'Arman and Adrian released their SRT-file parser library for Dart',
      summary: 'SRT-file Parser Release',
      rrule: IRecurrenceRule(frequency: IRecurrenceFrequency.YEARLY),
    ),
  );
  cal.addElement(
    IEvent(
      alarm: IAlarm.audio(
        duration: Duration(minutes: 3),
        repeat: 1,
        trigger: DateTime(2019, 4, 2, 11),
      ),
      description: 'Lukas releases his iCal-feed serializer',
      summary: 'ical_serializer Release',
      start: DateTime(2019, 4, 2, 11, 15),
      end: DateTime(2019, 4, 2, 11, 30),
      uid: 'lukas@himsel.me',
      organizer: IOrganizer(email: 'lukas@himsel.me', name: 'Lukas Himsel'),
      lat: 49.6782872,
      lng: 10.2425528,
    ),
  );

  await HttpServer.bind(InternetAddress.loopbackIPv4, 8080)
    ..listen((HttpRequest request) {
      request.response
        ..headers.contentType = ContentType('text', 'calendar')
        ..write(cal.serialize())
        ..close();
    });
  print('server running http://localhost:8080');
}

Full example in ./example

Implemented Features #

  • Basic Calendar Object
  • Event Element
  • To-Do Element
  • Journal Element
  • Alarm Component
  • Free/Busy Times
  • Timezones
  • Attachements (for Emails, Sound-Alarms, etc.)
  • Recurrence of Elements with RRULE
  • EXDATE
  • STATUS
  • ATTENDEE, [ ] CONTACT, [x] ORGANIZER Link
2
likes
0
pub points
0%
popularity

Publisher

verified publisherdartlang.rocks

A library to generate/serialize iCalendar files

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

intl, nanoid

More

Packages that depend on ical_serializer