Matcher<T> constructor
Matcher<T> ({
- required String trigger,
- required List<
T> suggestions, - required String idProp(
- dynamic suggestion
- required String displayProp(
- dynamic suggestion
- MatcherSearchStyle searchStyle = MatcherSearchStyle.iContains,
- int resultSort(
- String text,
- dynamic a,
- dynamic b
- int finalResultSort(
- String text,
- dynamic a,
- dynamic b
- required String stringify(
- String trigger,
- dynamic suggestion
- required T parse(),
- required RegExp parseRegExp,
- dynamic onSuggestionAdded(
- String trigger,
- dynamic suggestion
- TextStyle? style,
- Widget suggestionBuilder(
- Matcher matcher,
- dynamic suggestion
- bool alwaysHighlight = false,
This is the core of what makes flutter_parsed_text_field work. This is where you define what triggers suggestions, what those suggestions are, and how they are used.
Implementation
Matcher({
required this.trigger,
required this.suggestions,
required this.idProp,
required this.displayProp,
this.searchStyle = MatcherSearchStyle.iContains,
this.resultSort,
this.finalResultSort,
required this.stringify,
required this.parse,
required this.parseRegExp,
this.onSuggestionAdded,
this.style,
this.suggestionBuilder,
this.alwaysHighlight = false,
}) : assert(trigger.length == 1);