emptyIfNull<T> static method

List<T> emptyIfNull<T>({
  1. required List<T>? items,
})

Returns an empty list if the given parameter items is null. Otherwise the given list is returned.

Implementation

static List<T> emptyIfNull<T>({required List<T>? items}) {
  return items == null ? [] : items;
}