ical_serializer 0.0.3

  • Readme
  • Changelog
  • Example
  • Installing
  • 71

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 #

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

0.0.3 #

  • Update dependencies

0.0.2 #

  • Refresh interval implemented

0.0.1 #

  • Initial version, created by Stagehand

example/README.md

A web server built using Shelf.

Created from templates made available by Stagehand under a BSD-style license.

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  ical_serializer: ^0.0.3

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter pub get

Alternatively, your editor might support pub get or flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:ical_serializer/ical_serializer.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
53
Health:
Code health derived from static analysis. [more]
97
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
77
Overall:
Weighted score of the above. [more]
71
Learn more about scoring.

We analyzed this package on Dec 9, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.6.1
  • pana: 0.12.21

Health issues and suggestions

Document public APIs. (-1 points)

145 out of 145 API elements have no dartdoc comment.Providing good documentation for libraries, classes, functions, and other API elements improves code readability and helps developers find and use your API.

Fix lib/src/abstract.dart. (-0.50 points)

Analysis of lib/src/abstract.dart reported 1 hint:

line 76 col 7: DO use curly braces for all flow control structures.

Fix lib/src/calendar.dart. (-0.50 points)

Analysis of lib/src/calendar.dart reported 1 hint:

line 15 col 5: Don't explicitly initialize variables to null.

Fix lib/src/event.dart. (-0.50 points)

Analysis of lib/src/event.dart reported 1 hint:

line 67 col 7: DO use curly braces for all flow control structures.

Fix additional 5 files with analysis or formatting issues. (-1 points)

Additional issues in the following files:

  • lib/src/subcomponents.dart (1 hint)
  • lib/src/todo.dart (1 hint)
  • lib/src/availability.dart (Run dartfmt to format lib/src/availability.dart.)
  • lib/src/timezone.dart (Run dartfmt to format lib/src/timezone.dart.)
  • lib/src/utils.dart (Run dartfmt to format lib/src/utils.dart.)

Maintenance suggestions

The package description is too short. (-13 points)

Add more detail to the description field of pubspec.yaml. Use 60 to 180 characters to describe the package, what it does, and its target use case.

Package is pre-v0.1 release. (-10 points)

While nothing is inherently wrong with versions of 0.0.*, it might mean that the author is still experimenting with the general direction of the API.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0 <3.0.0
intl ^0.16.0 0.16.0
nanoid ^0.1.0 0.1.0
Transitive dependencies
path 1.6.4
Dev dependencies
test ^1.5.1+1