copyWith method

ErrorObject copyWith({
  1. int? code,
  2. Object? data,
  3. String? message,
})

A copy with the given properties replaced; everything else, unknown keys included, is kept.

Implementation

ErrorObject copyWith({
  int? code,
  Object? data,
  String? message,
}) =>
    ErrorObject.fromJson({
      ...toJson(),
      if (code != null) 'code': $encode(code),
      if (data != null) 'data': $encode(data),
      if (message != null) 'message': $encode(message),
    });