agent_kit library
agent_kit — Drop-in Flutter widgets for AI agent UIs. Tool-call cards, thinking bubbles, citation chips, plan-progress timelines. Backend-agnostic.
Classes
- AgentEvent
- Sealed union over the four event kinds an agent stream emits.
- AgentEventBuilder
- Low-level builder hook for an AgentEventStream.
- AgentKitStateColors
- Per-state color palette used by tool cards, plan steppers, etc.
- AgentKitTheme
-
Theme contract for every agent_kit widget. Inject via AgentKitThemeScope
or pass directly to a widget's
themeparameter. - AgentKitThemeScope
- Provides an AgentKitTheme to descendant agent_kit widgets.
- AgentTimeline
- Chronological feed of agent events.
- AgentView
- High-level "just give me the stream, I render everything" widget.
- Citation
- One retrieval-grounded citation backing an agent answer.
- CitationCard
- Richer citation card — favicon, title, host, snippet.
- CitationChip
- Inline numbered badge (Perplexity-style citation marker).
- CitationEvent
- Wraps a snapshot of citations attached to the current answer.
- CitationList
- Horizontally scrollable list of CitationCards.
- PlanEvent
- Wraps a snapshot of the agent's current plan tree.
- PlanProgress
- Vertical multi-step plan visualisation with live state transitions.
- PlanStep
- One node in an agent's plan tree.
- ReasoningTrace
- Collapsible reasoning log — the multi-step "thought process" UI.
- ThinkingBubble
- Claude / o1-style "thinking…" bubble.
- ThinkingEvent
- Wraps one ThinkingStep update.
- ThinkingStep
- One chunk of agent "reasoning" — the prose the model emits between receiving the user message and the final answer.
- ToolCall
- One agent tool invocation — name, arguments, current state, and (when settled) its result or error.
- ToolCallCard
- Hero widget for one ToolCall.
- ToolCallEvent
- Wraps one ToolCall lifecycle update.
- ToolCallFeed
- Vertically-stacked feed of ToolCallCards.
- ToolRenderer
- Registry of per-tool custom renderers.
Enums
- AgentKitDensity
- Visual density preset for agent_kit widgets.
- PlanStepState
- Lifecycle state for one step in a multi-step agent plan.
- ToolCallState
- Tool-call lifecycle state.
Typedefs
-
AgentEventStream
= Stream<
AgentEvent> - Convenience typedef for the public stream contract.
- ToolRendererBuilder = Widget Function(BuildContext context, ToolCall call)
- Custom renderer signature for one tool's expanded body.