copyWith method

InvalidRequestError copyWith({
  1. Object? data,
  2. String? message,
})

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

Implementation

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