copyWith method

McpIcon copyWith({
  1. String? mimeType,
  2. List<String>? sizes,
  3. String? src,
  4. McpIconTheme? theme,
})

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

Implementation

McpIcon copyWith({
  String? mimeType,
  List<String>? sizes,
  String? src,
  McpIconTheme? theme,
}) =>
    McpIcon.fromJson({
      ...toJson(),
      if (mimeType != null) 'mimeType': $encode(mimeType),
      if (sizes != null) 'sizes': $encode(sizes),
      if (src != null) 'src': $encode(src),
      if (theme != null) 'theme': $encode(theme),
    });