convertListFromDividedSource<E, H> static method

DateRemindList convertListFromDividedSource<E, H>(
  1. List<E> eventsSource,
  2. List<H> holidaySource, {
  3. required Events exportEvents(
    1. E
    ),
  4. required Holiday exportHoliday(
    1. H
    ),
})

Getting Events and Holiday on different classes

Unlike convertListFromSource, it reduced the workflow of checking Type and it will merge to DateRemindList after conversion completed.

Implementation

static DateRemindList convertListFromDividedSource<E, H>(
        List<E> eventsSource, List<H> holidaySource,
        {required Events Function(E) exportEvents,
        required Holiday Function(H) exportHoliday}) =>
    DateRemindList._resolver((dr) => dr
      ..addAll(eventsSource.map((e) => exportEvents(e)))
      ..addAll(holidaySource.map((h) => exportHoliday(h))));