copyWith method

dynamic copyWith({
  1. int? statusCode,
  2. String? message,
  3. dynamic data,
  4. int? affectedRows,
  5. dynamic extra,
  6. List<ValidationErrorModel>? required,
})

Creates a copy of the ResponseModel with the specified values.

This method can be used to create a new instance of ResponseModel that has the same values as the current instance, but with some values replaced by the values specified in the parameters.

Implementation

copyWith({
  int? statusCode,
  String? message,
  dynamic data,
  int? affectedRows,
  dynamic extra,
  List<ValidationErrorModel>? required,
}) {
  return ResponseModel(
    statusCode: statusCode ?? this.statusCode,
    message: message ?? this.message,
    data: data ?? this.data,
    affectedRows: affectedRows ?? this.affectedRows,
    extra: extra ?? this.extra,
    required: required ?? this.required,
  );
}