first method

Future<T?> first()

Implementation

Future<T?> first() async {
  limit(1);

  List<T> result = await get();

  if (result.isEmpty) {
    return null;
  }

  return result.first;
}