queryFirstValue method
Future
queryFirstValue(
- QueryPart query(
- T model
- ConditionQuery where(
- T model
- List<
FieldOrder> orderBy(- T model
Get first row first field value
Implementation
Future queryFirstValue(QueryPart Function(T model) query,
{ConditionQuery Function(T model)? where,
List<FieldOrder> Function(T model)? orderBy}) async {
// assert(query != null);
var result = await this.query(
queries: (model) => [query.call(model)],
where: where,
limit: 1,
orderBy: orderBy);
if (result != null) {
if (result is List) {
if (result.isNotEmpty) if (result[0] != null) return result[0].row[0];
}
}
return null;
}