A Flutter plugin that detects when a headset is plugged in or unplugged on Android and iOS devices. It provides real-time updates on the current headset connection state, enabling apps to respond dynamically to audio accessory changes. Ideal for media players, voice applications, or any app needing awareness of audio output configuration. The plugin integrates seamlessly with native device APIs through platform channels.
Use cases
- Media player audio routing
- Voice assistant input switching
- Real-time audio device monitoring
- User experience adaptation based on headset presence
- Accessibility feature triggering
Key features
- Real-time headset plug/unplug detection
- Cross-platform support (Android & iOS)
- Simple event stream API
- Current state retrieval
- Lightweight and minimal dependencies
Suitable for
- Audio-focused applications
- Mobile apps requiring hardware interaction
- Apps needing responsive UI to audio device changes
- Developers building accessibility tools
- Flutter projects targeting both Android and iOS
Considerations
- Requires appropriate permissions on Android
- Limited to headset connection events only
- No support for Bluetooth headsets beyond basic detection
- May require background execution handling on some platforms
- Dependent on native platform capabilities