addMore method

List<T> addMore(
  1. List<T>? origin,
  2. List<T> add, {
  3. bool toLast = true,
})

Implementation

List<T> addMore(List<T>? origin,List<T>add,{bool toLast=true}){
  origin=origin??[];
  origin.removeWhere((e) => add.any((ae) => getId(ae)==getId(e)));
  return toLast?(origin..addAll(add)):[...add,...origin];
}