combine method

void combine(
  1. RemoteList<T> newList, {
  2. bool concatList = true,
})

Combine new list into current list

Set concatList = false to replace list instead of concat list.

Old properties will be overriten by the new properties if the new properties are not null.

Implementation

void combine(RemoteList<T> newList, {bool concatList = true}) {
  if (concatList) {
    items.addAll(newList.items);
  } else {
    items = newList.items;
  }
  totalItem = newList.totalItem;
  page = newList.page;
  pageSize = newList.pageSize;
  search = newList.search ?? search;
  sortOptions = newList.sortOptions ?? sortOptions;
}