hangUp method
Returns true if the call was disconnected, false otherwise. See twilio_js.Call.disconnect
Implementation
@override
Future<bool?> hangUp() async {
if (_jsCall != null) {
// notify SW to cancel notification
final callSid = await getSid();
_cancelNotification(callSid!);
CallStatus callStatus = getCallStatus(_jsCall!);
// reject incoming call that is both outbound ringing or inbound pending
if (callStatus == CallStatus.ringing || callStatus == CallStatus.pending) {
_jsCall!.reject();
} else {
_jsCall!.disconnect();
}
return true;
}
return false;
}