copyWith method

List<E> copyWith(
  1. E element
)

Copy current list with adding element at the end of new list.

If current list is null - new list with element will be created.

Implementation

List<E> copyWith(E element) => this?.copyWith(element) ?? [element];