haivaagent 2.0.0+3 copy "haivaagent: ^2.0.0+3" to clipboard
haivaagent: ^2.0.0+3 copied to clipboard

Haivachat screen package for agent chat functionality.

HaivaAgent Flutter Package #

HaivaAgent is a customizable agent/chat widget package for Flutter, supporting Web, Android, and iOS platforms. It provides an easy way to integrate an agent or chatbot interface into your application with support for interactive actions and media.

Installation #

To use HaivaAgent, add it to your pubspec.yaml file:

dependencies:
  haiva_agent: latest_version

Run flutter pub get to install the package.

Usage #

Example #

import 'package:flutter/material.dart';
import 'package:haiva_agent/haiva_agent.dart';

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        body: Container(
          height: 300,
          child: HaivaAgent(
            agentId: 'YOUR-AGENT-ID', // Replace with your agent ID
            menuItems: [
              MenuItem(title: 'TITLE-OF-THE-SCREEN', screen: PAGE-TO-REDIRECT()),
            ],
            isAction: true, // Enable actions (set false if not needed)
          ),
        ),
      ),
    );
  }
}

Web Setup #

For web support, add the following script to your index.html file inside the web folder:

<script src="https://cdnjs.cloudflare.com/ajax/libs/howler/2.2.3/howler.min.js"></script>

This script enables audio playback functionalities (e.g., notifications, voice interactions) in web applications.

Android Permissions #

To use features like internet connectivity, voice recording, and Bluetooth communication on Android, ensure the following permissions are added to your AndroidManifest.xml:

<uses-permission android:name="android.permission.RECORD_AUDIO"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.BLUETOOTH"/>
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/>
<uses-permission android:name="android.permission.BLUETOOTH_CONNECT"/>

iOS Setup #

For iOS, ensure that you add necessary permissions for Bluetooth and microphone access in your Info.plist file, as well as any required configurations for networking.

<key>NSMicrophoneUsageDescription</key>
<string>This app requires access to the microphone for voice interaction.</string>
<key>NSBluetoothAlwaysUsageDescription</key>
<string>This app requires access to Bluetooth devices.</string>

License #

This package is available under the MIT License.