AutoComplete class
Engine for auto-completion of Strings.
Add entries to build up the suggestion bank. Then, you can use the suggest method to get the auto-completions for the beginning of a String.
Constructors
-
AutoComplete({required SortEngine engine, List<
String> ? bank}) -
Constructs an instance of
AutoComplete
. - AutoComplete.fromFile({required File file, required SortEngine engine})
Properties
-
allEntries
→ Iterable<
String> -
Get all the entries in a list.
no setter
- changedSincePersist ↔ bool
-
Whether this autocompletion engine has changed since the last time
persist
was called.getter/setter pair - hashCode → int
-
The hash code for this object.
no setterinherited
- isEmpty → bool
-
Returns true if this engine has no entries.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
clearEntries(
) → void - Clear all the entries. The engine is now blank.
-
contains(
String entry) → bool -
Returns true if this engine contains
entry
. -
delete(
String entry) → void -
Deletes
entry
from the engine if it exists. -
enter(
String entry) → void - Add an entry to the engine.
-
enterList(
List< String> entries) → void - Add multiple entries to the engine.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
persist(
File file) → Future< void> - Takes a file and writes the entire engine to it. You can then rebuild this engine at some point in the future from the file.
-
suggest(
String prefix) → List< String> - Suggest entries based on the beginning of the string.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited