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',
isAction: 'true', // if u want to add screen redirection
workspaceId: '',
orgId: '',
accessToken: '',
menuItems: [], // add screen titles and its page to redirect
agentSetting: true, // to customize the agent
agentType: 'Analytics', // to have an analytics agent [Sales, Education,Personal Copilot] also available
),
),
),
);
}
}
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.
Libraries
- constants
- haiva-flow/azure-stt
- haiva-flow/chatbubble_haiva
- haiva-flow/customcomponenthaiva
- haiva-flow/customcomponentmobile
- haiva-flow/flow_chat_haiva
- haivaScreen_pkg
- handler/customcomponent
- main
- model/agent_detail
- model/chat-transcript
- model/file_configs
- model/responsemsg
- model/welcomemessage
- pages/Comming-soon-page
- pages/configure_page
- pages/connection_page
- pages/connection_table_page
- pages/db_config
- pages/deploy_info
- pages/file-storage/fileUpload_page
- pages/file-storage/folderUpload_page
- pages/file-storage/listFiles_page
- pages/file-storage/listFolderFiles_page
- pages/file-storage/selectedFiles_page
- pages/settings_page
- pages/talk_page
- providers/agent_provider
- providers/spokenmessage
- service/agent_service
- service/audio_service
- service/db_service
- service/deploy_service
- service/file_upload_service
- service/haivaservice
- service/pricingValidation_service
- service/service
- service/transcript-service
- service/tts
- statemanagement/chatstate
- statemanagement/spokenmessage
- theme/colortheme
- theme/queryparamlistner
- theme/texttheme
- widget/advanceMarkdown
- widget/bubble
- widget/chart
- widget/chatbubble
- widget/cupertino_filter_chip
- widget/dropdown
- widget/form
- widget/latexselectable
- widget/radio
- widget/selecthtml
- widget/selectmarkdown
- widget/table
- widget/textfield