firstOrDefault method

dynamic firstOrDefault({
  1. dynamic defValue,
})

A method to get thye first element or null (if the list is empty)

Implementation

dynamic firstOrDefault({dynamic defValue}) => (isEmpty ? defValue : first);