AiConfirmation class
An approve/deny card for actions an agent wants to take (running a tool, sending an email, making a purchase) — the human-in-the-loop gate.
The card only reports intent through onConfirm/onDeny. The host (or the agent engine) executes and persists the decision and reflects it back through status, so a settled card survives rebuilds, list eviction and restarts without offering the buttons again.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatelessWidget
- AiConfirmation
Constructors
- AiConfirmation({Key? key, required String title, String? description, String? confirmLabel, String? denyLabel, VoidCallback? onConfirm, VoidCallback? onDeny, IconData icon = Icons.shield_outlined, AiConfirmationTone tone = AiConfirmationTone.neutral, AiConfirmationStatus status = AiConfirmationStatus.awaiting})
-
Creates a confirmation card.
const
Properties
- confirmLabel → String?
-
Label for the confirm button. Defaults to the localized "Allow".
final
- denyLabel → String?
-
Label for the deny button. Defaults to the localized "Deny".
final
- description → String?
-
Optional supporting detail.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- icon → IconData
-
Leading icon.
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- onConfirm → VoidCallback?
-
Called when the user approves.
final
- onDeny → VoidCallback?
-
Called when the user denies.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- status → AiConfirmationStatus
-
The host-owned lifecycle state. Only AiConfirmationStatus.awaiting
shows the buttons; other states show a status line instead.
final
- title → String
-
The action being confirmed.
final
- tone → AiConfirmationTone
-
The action's weight, which restyles the confirm button. Defaults to
AiConfirmationTone.neutral (the original accent look).
final
Methods
-
build(
BuildContext context) → Widget -
Describes the part of the user interface represented by this widget.
override
-
createElement(
) → StatelessElement -
Creates a StatelessElement to manage this widget's location in the tree.
inherited
-
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