NmCopilotController class
State of an NmCopilotSheet: the input, suggestions for it, the history, the last result and the error; the app supplies process (the model / search behind the copilot) and suggestionsFor. Added in 0.3.0.
- Inheritance
-
- Object
- ChangeNotifier
- NmCopilotController
Constructors
-
NmCopilotController({required Future<
NmCopilotResult> process(String query), required List<String> suggestionsFor(String input)}) - Creates an NmCopilotController.
Properties
- busy → bool
-
Whether a question is being answered.
no setter
- error → String?
-
The last error (cleared by clearError).
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- hasListeners → bool
-
Whether any listeners are currently registered.
no setterinherited
-
history
→ List<
String> -
Asked questions, oldest first.
no setter
- input → String
-
Current text of the field.
no setter
-
process
→ Future<
NmCopilotResult> Function(String query) -
Answers a question.
final
- result → NmCopilotResult?
-
The last answer.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
suggestions
→ List<
String> -
Suggestions for input.
no setter
-
suggestionsFor
→ List<
String> Function(String input) -
Suggested questions for the current input (empty input: the starters).
final
Methods
-
addListener(
VoidCallback listener) → void -
Register a closure to be called when the object changes.
inherited
-
ask(
String query) → Future< void> -
Asks
query. -
clearError(
) → void - Hides the error banner.
-
dispose(
) → void -
Discards any resources used by the object.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
notifyListeners(
) → void -
Call all the registered listeners.
inherited
-
removeListener(
VoidCallback listener) → void -
Remove a previously registered closure from the list of closures that are
notified when the object changes.
inherited
-
setInput(
String text) → void - Updates the input.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited