convertListFromSource<S> static method

DateRemindList convertListFromSource<S>(
  1. List<S> source, {
  2. required bool eventsCondition(
    1. S
    ),
  3. required bool holidayCondition(
    1. S
    ),
  4. required Events exportEvents(
    1. S
    ),
  5. required Holiday exportHoliday(
    1. S
    ),
})

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));
      });
    });