phone_state
4.0.1, released 4 months ago by an unverified publisher
Detects incoming calls and phone call status on Android and iOS.
What it does
Allows you to quickly know if your Android or iOS device is receiving a call and track the current status of the call via a stream. On Android, it can also provide the caller's phone number if the optional permission is granted.
AI-written summary of version 4.0.1, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need to detect incoming phone calls in your app
- You need to monitor the status changes of cellular phone calls on Android or iOS
Skip it when
- You need to answer, reject, end, or record phone calls
- You need to detect VoIP calls from apps like WhatsApp or Telegram
Strengths
- Easy-to-use stream-based API for call state tracking
- Supports both Android and iOS platforms
- Provides call duration updates
Weaknesses
- Does not work on the iOS simulator
- Caller phone number is only available on Android, not iOS
- Does not support third-party VoIP calls from apps like WhatsApp or Telegram
Setup
- Kind
- Plugin (native code)
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 1
Add READ_PHONE_STATE permission to AndroidManifest.xml. READ_CALL_LOG is optional and only needed for caller phone numbers on Android.
StreamBuilder<PhoneState>(
stream: PhoneState.stream,
builder: (context, snapshot) {
return Text('Call state: ${snapshot.data}');
},
)Alternatives
Packages that do the same job and could replace phone_state.
- wakelock_plus
Keep the device screen awake across mobile, desktop, and web platforms.
92Compare - fpjs_pro_plugin
Flutter plugin to call native FingerprintJS Pro libraries for device identification.
79Compare - nordic_dfu
Perform Device Firmware Updates on Nordic nRF51 and nRF52 chips.
85Compare - plugin_wifi_connect
Connects mobile devices to Wi-Fi networks using a specific SSID or SSID prefix.
77Compare