first method

Future<T?> first()

Retrieves at most one LCObject matching this query.

Implementation

Future<T?> first() async {
  limit(1);
  List<T>? results = await find();
  if (results != null && results.length > 0) {
    return results.first;
  }
  return null;
}