flutter_ui_agent library
Flutter UI Agent - A revolutionary package that enables AI agents to understand and interact with your app's UI using natural language commands.
This package provides three core components:
- AgentService: The brain that manages actions and processes queries
- AgentHost: The integration point that wraps your MaterialApp
- AiActionWidget: A wrapper to make widgets actionable by the agent
- AgentServiceProvider: Pure Flutter state management for AgentService
- AgentNavigatorObserver: Automatic page tracking for navigation changes
Classes
- AgentAction
- Represents an action that the agent can execute
- AgentActionParameter
- Metadata describing a parameter that an agent action accepts
- AgentConfig
- Configuration for the agent service
- AgentHost
- The main widget that hosts the agent and provides it to the widget tree
- A NavigatorObserver that tracks route changes and updates the AgentService with the current page/route information.
- AgentService
- The central service that manages all agent actions and LLM communication
- AgentServiceProvider
- A pure Flutter InheritedWidget that provides AgentService to the widget tree This replaces the Provider package dependency
- AiActionWidget
- A wrapper widget that registers a UI element as an actionable item for the agent
- ConversationMessage
- Represents a message in conversation history
- LlmFunctionCall
- Represents a function call returned by the LLM
- LlmProvider
-
Simple LLM provider interface. Implement this in your app and pass an
instance into
AgentService.setLlmProvider(...). - LlmResponse
- Lightweight response object returned by an LLM provider
- SystemPromptContext
- Context that is passed to the system prompt builder.
Enums
- AgentLogLevel
- Logging levels for the agent service
- AgentParameterType
- Supported parameter types for agent actions
- RetryBackoffStrategy
- Strategy for calculating retry delays
Typedefs
- SystemPromptBuilder = String Function(SystemPromptContext context)
- Signature for building a custom system prompt.