SingleOrDefaultExtension<T> extension

on

Methods

singleOrDefault({required T defaultValue}) → T

Available on Iterable<T>, provided by the SingleOrDefaultExtension extension

Returns the single element in the iterable, or a defaultValue if no such element exists.