copyWith method

ListRootsResult copyWith({
  1. Map<String, Object?>? meta,
  2. List<Root>? roots,
})

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

Implementation

ListRootsResult copyWith({
  Map<String, Object?>? meta,
  List<Root>? roots,
}) =>
    ListRootsResult.fromJson({
      ...toJson(),
      if (meta != null) '_meta': $encode(meta),
      if (roots != null) 'roots': $encode(roots),
    });