selectFirstWhere method
Future<T?>
selectFirstWhere(
- ConditionQuery where(
- T model
- List<
FieldOrder> orderBy(- T model
- int? offset,
- List<
FieldWithValue> desiredFields(- T model
Get first entry matching where
.
Implementation
Future<T?> selectFirstWhere(ConditionQuery Function(T model) where,
{List<FieldOrder> Function(T model)? orderBy,
int? offset,
List<FieldWithValue> Function(T model)? desiredFields}) async {
var result = (await select(
where: where, orderBy: orderBy, limit: 1, offset: offset));
return result.isNotEmpty ? result.first : null;
}