copyWith method

ProgressNotificationParams copyWith({
  1. NotificationMetaObject? meta,
  2. String? message,
  3. num? progress,
  4. Object? progressToken,
  5. num? total,
})

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

Implementation

ProgressNotificationParams copyWith({
  NotificationMetaObject? meta,
  String? message,
  num? progress,
  Object? progressToken,
  num? total,
}) =>
    ProgressNotificationParams.fromJson({
      ...toJson(),
      if (meta != null) '_meta': $encode(meta),
      if (message != null) 'message': $encode(message),
      if (progress != null) 'progress': $encode(progress),
      if (progressToken != null) 'progressToken': $encode(progressToken),
      if (total != null) 'total': $encode(total),
    });