ListNullExtension<T> extension

on

Properties

firstOrNull → T?

Available on List<T>?, provided by the ListNullExtension extension

Returns the first element or null if list is null or empty
no setter
isNotNullAndNotEmpty bool

Available on List<T>?, provided by the ListNullExtension extension

Returns true if the list is not null and not empty
no setter
isNullOrEmpty bool

Available on List<T>?, provided by the ListNullExtension extension

Returns true if the list is null or empty
no setter
lastOrNull → T?

Available on List<T>?, provided by the ListNullExtension extension

Returns the last element or null if list is null or empty
no setter

Methods

repeat(int times) List<T>

Available on List<T>?, provided by the ListNullExtension extension

🚀 Repeats the list items times number of times If list is null/empty or times <= 0, returns an empty list.
validate() List<T>

Available on List<T>?, provided by the ListNullExtension extension

Returns the list if not null, otherwise returns an empty list