copyWith method

PaginadoModel copyWith({
  1. String? coleccion,
  2. int? totalItems,
  3. int? skip,
  4. int? subTotal,
  5. int? limit,
  6. Map<String, dynamic>? params,
})

Implementation

PaginadoModel copyWith({
  String? coleccion,
  int? totalItems,
  int? skip,
  int? subTotal,
  int? limit,
  Map<String, dynamic>? params,
}) {
  int total = totalItems ?? this.totalItems;
  int lim = limit ?? this.limit;

  return PaginadoModel(
    coleccion: coleccion ?? this.coleccion,
    totalItems: totalItems ?? this.totalItems,
    subTotal: subTotal ?? this.subTotal,
    skip: skip ?? this.skip,
    mostrarPaginacion: total > lim,
    params: params ?? this.params,
  );
}