getSingleOrNull method
Executes this statement, like get, but only returns one
value. If the result too many values, this method will throw. If no
row is returned, null will be returned instead.
See also: getSingle, which can be used if the query will
always evaluate to exactly one row.
Uses the distinct flag to ensure that only distinct rows are returned
Implementation
@override
Future<DT?> getSingleOrNull() =>
$state.copyWith(distinct: true).buildSelectStatement().getSingleOrNull();