limit method

List<SimilarityIndex> limit([
  1. int? limit = 10
])

Returns the first limit instances of the collection.

Returns the entire collection as an ordered list if limit is null.

Implementation

List<SimilarityIndex> limit([int? limit = 10]) {
  final list = List<SimilarityIndex>.from(this);
  return (limit != null && list.length > limit)
      ? list.sublist(0, limit)
      : list;
}