copyWith method

SetLevelRequest copyWith({
  1. SetLevelRequestParams? params,
  2. Object? id,
})

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

Implementation

SetLevelRequest copyWith({
  SetLevelRequestParams? params,
  Object? id,
}) =>
    SetLevelRequest.fromJson({
      ...toJson(),
      if (params != null) 'params': $encode(params),
      if (id != null) 'id': $encode(id),
    });