differenceBy function Null safety

List differenceBy(
  1. List array,
  2. List values,
  3. Function iteratee

This method is like _.difference except that it accepts iteratee which is invoked for each element nt of array and values to generate the criterion by which they're compared. The order and references of result values are determined by the first array. The iteratee is invoked with one argument:


List differenceBy(List array, List values, Function iteratee) {
  return array.where((element) => !values.contains(iteratee(element))).toList();