SherlockCompletion class

Tool to complete the user input in search bars.

This is not AI. It works with Sherlock. For example, it can complete the name the user is writing from the names database if a user wants to find someone from their name. "Linus To" (user input) -> "Linus Torvalds" (completion/suggestion).

Also called "suggestions" instead of "completions" in the SearchAnchor by Flutter.

Constructors

SherlockCompletion({required String where, required dynamic elements})
Creates a new SherlockCompletions. Basically the given elements are the same given to the Sherlock object which might have been built before for researches.

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
sherlock Sherlock
Researcher to find completion texts from the given elements.
final
where String
Example/Explanations
final

Methods

getStrings({required List<Result> fromResults}) Future<List<String>>
Returns the value of where for each result's element in order to return a list of strings instead of results.
input({required String input, bool caseSensitive = false, bool? caseSensitiveFurtherSearches, int? minResults, int? maxResults}) Future<List<Result>>
Returns the possible completions of the given user input.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

unchangedRanges({required String input, required List<String> results}) Future<List<Range>>
Returns the range of the text which has not been changed by the completions for each completion.