match_sorter library

Support for doing something awesome.

More dartdocs go here.

Classes

Key

Enums

Ranking

Constants

defaultKeys → const List<Key>
Default key to be used when using stringsToItems or when keys are not provided

Functions

matchSorter({required String searchQuery, required List<Item> items, List<Key> keys = defaultKeys, Ranking threshold = Ranking.matches, bool keepDiacritics = false, BaseSortFn baseSort = _defaultBaseSort, SorterFn? sorter}) List<Item>
Returns the highest ranking item match for a given search query considering all keys and options
stringsToItems(List<String> strings) List<Item>
Converts a list of strings to a list of items <List<Map<String, dynamic>>>
stringsToKeys(List<String> strings) List<Key>
Converts a list of strings to a list of keys

Typedefs

BaseSortFn = int Function(_RankedItem a, _RankedItem b)
Item = Map<String, dynamic>
SorterFn = List<_RankedItem> Function(List<_RankedItem> items)
SortRankedFn = int Function(_RankedItem a, _RankedItem b, BaseSortFn baseSort)