PrismPromptComposer class
An input row for prompting an AI assistant.
A token-styled text field with a send button, optional suggestion chips
shown above the field, and an optional busy state that disables the send
button and shows a spinner. Wire it to your own AiChatController or any
AiStreamClient — the composer never touches the network itself.
PrismPromptComposer(
suggestions: const ['Summarise', 'Translate to Urdu'],
busy: controller.isStreaming,
onSend: controller.send,
)
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- PrismPromptComposer
Constructors
-
PrismPromptComposer({Key? key, required ValueChanged<
String> onSend, List<String> suggestions = const [], bool busy = false, String hint = 'Ask anything…', String sendTooltip = 'Send message', int maxLines = 5, TextEditingController? controller, ValueChanged<String> ? onSuggestionTap}) -
Creates a prompt composer.
const
Properties
- busy → bool
-
Disables the send button and shows a spinner while a reply streams.
final
- controller → TextEditingController?
-
Optional external controller; the composer owns one otherwise.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- hint → String
-
Hint text for the field.
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- maxLines → int
-
Maximum lines the field grows to.
final
-
onSend
→ ValueChanged<
String> -
Called with the composed text when the user sends. The composer clears
its field afterwards.
final
-
onSuggestionTap
→ ValueChanged<
String> ? -
Called when a suggestion chip is tapped instead of sending immediately.
When null, tapping a chip sends it right away.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- sendTooltip → String
-
Tooltip/semantics label for the send button.
final
-
suggestions
→ List<
String> -
Optional one-tap prompts rendered as chips above the field.
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< PrismPromptComposer> -
Creates the mutable state for this widget at a given location in the tree.
override
-
debugDescribeChildren(
) → List< DiagnosticsNode> -
Returns a list of DiagnosticsNode objects describing this node's
children.
inherited
-
debugFillProperties(
DiagnosticPropertiesBuilder properties) → void -
Add additional properties associated with the node.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toDiagnosticsNode(
{String? name, DiagnosticsTreeStyle? style}) → DiagnosticsNode -
Returns a debug representation of the object that is used by debugging
tools and by DiagnosticsNode.toStringDeep.
inherited
-
toString(
{DiagnosticLevel minLevel = DiagnosticLevel.info}) → String -
A string representation of this object.
inherited
-
toStringDeep(
{String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) → String -
Returns a string representation of this node and its descendants.
inherited
-
toStringShallow(
{String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) → String -
Returns a one-line detailed description of the object.
inherited
-
toStringShort(
) → String -
A short, textual description of this widget.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited