firstWhere method

Future<T?> firstWhere(
  1. String column,
  2. dynamic value
)

Get the first record matching a condition.

Implementation

Future<T?> firstWhere(String column, dynamic value) async
{
  final rows = await dbService.get(table, where: '$column = ?', params: [value], limit: 1);
  return rows.isNotEmpty ? fromMap(rows.first) : null;
}