A Flutter sample application demonstrating an AI-powered voice agent for credit card sales. This app showcases real-time voice interaction capabilities using the EnableX Voice Bot SDK, featuring an intuitive animated UI with live speaking indicators.
Before you begin, ensure you have the following installed:
- Flutter SDK: Version 3.9.2 or higher
- Dart SDK: Compatible with Flutter 3.9.2+
- Android Studio or VS Code with Flutter extensions
- Android SDK (for Android development)
- Xcode (for iOS development, macOS only)
- EnableX Account: You'll need a virtual number from EnableX
-
Clone the repository
git clone https://github.com/yourusername/voice_bot_sample_app.git cd voice_bot_sample_app -
Install dependencies
flutter pub get
-
Configure your virtual number
Open
lib/voice_agent_screen.dartand update thevirtualNumbervariable:var virtualNumber = "your_virtual_number_here";
-
Run the app
flutter run
The app requires microphone permissions. These are already configured in the Android manifest. Ensure you grant microphone permissions when prompted.
Add the following to ios/Runner/Info.plist:
<key>NSMicrophoneUsageDescription</key>
<string>This app needs access to microphone for voice calls</string>The app fetches tokens from:
https://botsdemo.enablex.io/get-token/?phone={virtualNumber}
Make sure your virtual number is registered with EnableX and the token endpoint is accessible.
- Launch the app - The voice agent screen will be displayed
- Get Started - Tap the "Get Started" button to initiate a connection
- Wait for connection - The status will show "CONNECTING..." and then "CONNECTED"
- Interact with the agent - Speak naturally; the app will show when you or the bot is speaking
- Mute/Unmute - Use the microphone button to mute or unmute your audio
- Disconnect - Tap "Disconnect" to end the call
lib/
├── main.dart # App entry point
└── voice_agent_screen.dart # Main voice agent UI and logic
assets/
└── app_icon.png # App icon
android/ # Android-specific configuration
ios/ # iOS-specific configuration
- enx_voice_bot: ^0.1.1 - EnableX Voice Bot SDK for Flutter
- http: ^1.6.0 - HTTP client for API calls
- permission_handler: ^12.0.1 - Handle runtime permissions
- flutter_launcher_icons: ^0.14.4 - Generate app icons
- cupertino_icons: ^1.0.8 - iOS-style icons
- Control Buttons:
- Connect/Disconnect button
- Mute/Unmute button (visible when connected)
- Verify your virtual number is correctly configured
- Check internet connectivity
- Ensure the EnableX token endpoint is accessible
- Grant microphone permissions when prompted
- Check app settings if permissions were denied
- Run
flutter cleanandflutter pub get - Ensure all prerequisites are installed
- Check Flutter doctor:
flutter doctor
- ✅ Android
- ✅ iOS
This project is a sample application. Please refer to EnableX's terms of service for SDK usage.
Contributions are welcome! Please feel free to submit a Pull Request.
For issues related to:
- EnableX SDK: Contact EnableX support
- App Issues: Open an issue on GitHub
- EnableX for providing the Voice Bot SDK
- Flutter team for the amazing framework