findOne method
Retrieves a single model of type T that satisfies the given filter.
filter
: The filtering criteria function.
Returns: A model of type T or null if not found.
Implementation
Future<T?> findOne({
required bool Function(T) filter,
}) async {
final models = await list();
return models.firstWhereOrNull(filter);
}