convertListFromSource<S> static method
Load a List of source
from other classes
Define eventsCondition
and holidayCondition
to check S
is validate
structre to create Events or Holiday.
Once it mathced, it will generated to Events or Holiday in
exportEvents
or exportHoliday
Implementation
static DateRemindList convertListFromSource<S>(List<S> source,
{required bool Function(S) eventsCondition,
required bool Function(S) holidayCondition,
required Events Function(S) exportEvents,
required Holiday Function(S) exportHoliday}) =>
DateRemindList._resolver((dr) {
source.forEach((srcdr) {
if (eventsCondition(srcdr)) dr.add(exportEvents(srcdr));
if (holidayCondition(srcdr)) dr.add(exportHoliday(srcdr));
});
});