extractSorted<T> method

List<ExtractedResult<T>> extractSorted<T>(
  1. String query,
  2. List<T> choices,
  3. Applicable func, [
  4. String getter(
    1. T obj
    )?,
])

Creates a sorted list of ExtractedResult from the most similar choices to the least.

Implementation

List<ExtractedResult<T>> extractSorted<T>(
    String query, List<T> choices, Applicable func,
    [String Function(T obj)? getter]) {
  var best = extractWithoutOrder(query, choices, func, getter)..sort();
  return best.reversed.toList();
}