remove method

PaginatedList<T> remove(
  1. T item, {
  2. bool update = false,
})

removes an item from the list. Set update to true in order to remove one to the total value. Keep in mind that total tracks the length of the remote list, so you might get inconsistencies when editing it

Implementation

PaginatedList<T> remove(
  T item,
  {bool update = false}
) {
  return PaginatedList(
    items: List.of(items)..remove(item),
    page: page,
    total: total - (update ? 1 : 0)
  );
}