registerField static method
void
registerField({})
Allow to add custom field to parse.
If no function
parameter to parse the field is provided the default
method generateSimpleParamFunction
will be used.
If a field with the same name already exists the method will throw a
ICalendarFormatException
.
Implementation
static void registerField({
required String field,
Function(String value, Map<String, String> params, List event,
Map<String, dynamic> lastEvent)?
function,
}) {
if (_objects.containsKey(field)) {
throw ICalendarFormatException('The field $field is already registered.');
}
_objects[field] =
function ?? generateSimpleParamFunction(field.toLowerCase());
}