copyWith method

ListTasksResult copyWith({
  1. Map<String, Object?>? meta,
  2. String? nextCursor,
  3. List<Task>? tasks,
})

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

Implementation

ListTasksResult copyWith({
  Map<String, Object?>? meta,
  String? nextCursor,
  List<Task>? tasks,
}) =>
    ListTasksResult.fromJson({
      ...toJson(),
      if (meta != null) '_meta': $encode(meta),
      if (nextCursor != null) 'nextCursor': $encode(nextCursor),
      if (tasks != null) 'tasks': $encode(tasks),
    });