copyWith method

JSONRPCNotification copyWith({
  1. String? method,
  2. Map<String, Object?>? params,
})

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

Implementation

JSONRPCNotification copyWith({
  String? method,
  Map<String, Object?>? params,
}) =>
    JSONRPCNotification.fromJson({
      ...toJson(),
      if (method != null) 'method': $encode(method),
      if (params != null) 'params': $encode(params),
    });