Deploy your agent to Flutter

The okatagonplugin package wraps your Oktagon agent inside a native WebView so you can ship the full chat experience on iOS and Android with just a few lines of Flutter code.

1. Add the plugin

Install the package from pub.dev:

flutter pub add okatagonplugin

Or update pubspec.yaml manually:

dependencies:
  okatagonplugin: ^0.1.3

Finish by running flutter pub get so the dependency is available in your project.

2. Render the Oktagon widget

Import the package and provide the agent ID from the Oktagon dashboard. The widget ships with sensible defaults for Android and iOS.

OkatagonAgentView(
  agentId: 'YOUR_AGENT_ID',
)

The WebView handles sign-in, file uploads, and real-time messaging automatically.

3. Customize the chat surface

OkatagonAgentView exposes optional knobs so you can tune the experience:

  • baseUrl — point at a staging or self-hosted Oktagon instance.
  • queryParameters — append values like chatbotId, userId, or metadata.
  • customHeaders — send auth tokens or tenant routing headers.
  • height and width — lock the WebView to a specific size inside layouts.
  • onError — respond to WebView load failures with a custom fallback.

Check the bundled example/ directory in the package for a fully wired sample app.

View install guide Browse the source