firstAs<T> method
Returns the first row mapped to T, or null if the result is empty.
final user = result.firstAs(User.fromJson);
Implementation
T? firstAs<T>(T Function(Map<String, dynamic> row) mapper) {
final row = first;
return row != null ? mapper(row) : null;
}