|
|
|
|
@ -7,12 +7,12 @@ import 'package:flutter_webrtc/flutter_webrtc.dart';
|
|
|
|
|
import 'package:just_audio/just_audio.dart';
|
|
|
|
|
import 'package:mohem_flutter_app/app_state/app_state.dart';
|
|
|
|
|
import 'package:mohem_flutter_app/classes/utils.dart';
|
|
|
|
|
import 'package:mohem_flutter_app/classes/voip_chat_call.dart';
|
|
|
|
|
import 'package:mohem_flutter_app/main.dart';
|
|
|
|
|
import 'package:mohem_flutter_app/models/chat/call.dart';
|
|
|
|
|
import 'package:mohem_flutter_app/models/chat/incomingCall.dart';
|
|
|
|
|
import 'package:mohem_flutter_app/models/chat/get_single_user_chat_list_model.dart';
|
|
|
|
|
import 'package:mohem_flutter_app/models/chat/webrtc_payloads.dart';
|
|
|
|
|
import 'package:mohem_flutter_app/provider/chat_provider_model.dart';
|
|
|
|
|
import 'package:mohem_flutter_app/ui/chat/call/chat_incoming_call_screen.dart';
|
|
|
|
|
import 'package:mohem_flutter_app/ui/chat/call/start_call_screen.dart';
|
|
|
|
|
import 'package:mohem_flutter_app/ui/landing/dashboard_screen.dart';
|
|
|
|
|
import 'package:uuid/uuid.dart';
|
|
|
|
|
@ -27,7 +27,6 @@ class ChatCallProvider with ChangeNotifier, DiagnosticableTreeMixin {
|
|
|
|
|
final AudioPlayer player = AudioPlayer();
|
|
|
|
|
late MediaStream localStream;
|
|
|
|
|
late CallDataModel outGoingCallData;
|
|
|
|
|
late IncomingCallDataPayload inComingCallData;
|
|
|
|
|
bool isMicOff = false;
|
|
|
|
|
bool isLoudSpeaker = false;
|
|
|
|
|
bool isCamOff = false;
|
|
|
|
|
@ -36,10 +35,12 @@ class ChatCallProvider with ChangeNotifier, DiagnosticableTreeMixin {
|
|
|
|
|
bool isCallStarted = false;
|
|
|
|
|
bool isFrontCamera = true;
|
|
|
|
|
bool isOnIncomingCallPage = false;
|
|
|
|
|
late SingleUserChatModel incomingCallData;
|
|
|
|
|
|
|
|
|
|
/// WebRTC Connection Variables
|
|
|
|
|
bool _offer = false;
|
|
|
|
|
//bool _offer = false;
|
|
|
|
|
bool isIncomingCallLoader = true;
|
|
|
|
|
bool isIncomingCall = false;
|
|
|
|
|
late BuildContext providerContext;
|
|
|
|
|
|
|
|
|
|
/// Temp Variable Remove After Development
|
|
|
|
|
@ -90,7 +91,10 @@ class ChatCallProvider with ChangeNotifier, DiagnosticableTreeMixin {
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
Future<void> init() async {
|
|
|
|
|
creatOfferWithCon();
|
|
|
|
|
_pc = await creatOfferWithCon();
|
|
|
|
|
Future.delayed(const Duration(seconds: 2), () {
|
|
|
|
|
connectIncomingCall();
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Future<void> initLocalCamera({required ChatProviderModel chatProvmodel, required callData, required BuildContext context, bool isIncomingCall = false}) async {
|
|
|
|
|
@ -131,6 +135,20 @@ class ChatCallProvider with ChangeNotifier, DiagnosticableTreeMixin {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Future<bool> endCall() async {
|
|
|
|
|
if (isIncomingCall) {
|
|
|
|
|
await invoke(invokeMethod: "UpdateUserStatusAsync", currentUserID: AppState().chatDetails!.response!.id!, targetUserID: incomingCallData.targetUserId!, userStatus: 1);
|
|
|
|
|
await invoke(invokeMethod: "HangUpAsync", currentUserID: AppState().chatDetails!.response!.id!, targetUserID: incomingCallData.targetUserId!, userStatus: 1);
|
|
|
|
|
_pc.dispose();
|
|
|
|
|
isCallStarted = false;
|
|
|
|
|
isVideoCall = false;
|
|
|
|
|
isCamOff = false;
|
|
|
|
|
isMicOff = false;
|
|
|
|
|
isLoudSpeaker = false;
|
|
|
|
|
localVideoRenderer.srcObject = null;
|
|
|
|
|
remoteRenderer.srcObject = null;
|
|
|
|
|
isIncomingCall = false;
|
|
|
|
|
return true;
|
|
|
|
|
} else {
|
|
|
|
|
await invoke(invokeMethod: "UpdateUserStatusAsync", currentUserID: outGoingCallData.callerId!, targetUserID: outGoingCallData.receiverId!, userStatus: 1);
|
|
|
|
|
await invoke(invokeMethod: "HangUpAsync", currentUserID: outGoingCallData.callerId!, targetUserID: outGoingCallData.receiverId!, userStatus: 1);
|
|
|
|
|
_pc.dispose();
|
|
|
|
|
@ -142,9 +160,10 @@ class ChatCallProvider with ChangeNotifier, DiagnosticableTreeMixin {
|
|
|
|
|
localVideoRenderer.srcObject = null;
|
|
|
|
|
remoteRenderer.srcObject = null;
|
|
|
|
|
//player.stop();
|
|
|
|
|
_offer = false;
|
|
|
|
|
// _offer = false;
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// OutGoing Listeners
|
|
|
|
|
void onCallAcceptedAsync(List<Object?>? params) async {
|
|
|
|
|
@ -157,8 +176,13 @@ class ChatCallProvider with ChangeNotifier, DiagnosticableTreeMixin {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Future<void> onIceCandidateAsync(List<Object?>? params) async {
|
|
|
|
|
print("--------------------- onIceCandidateAsync ---------------------------------------");
|
|
|
|
|
var items = params!.toList();
|
|
|
|
|
if (isIncomingCall) {
|
|
|
|
|
RemoteIceCandidatePayLoad data = RemoteIceCandidatePayLoad.fromJson(jsonDecode(items.first.toString()));
|
|
|
|
|
if (_pc != null) {
|
|
|
|
|
await _pc.addCandidate(RTCIceCandidate(data.candidate!.candidate, data.candidate!.sdpMid, data.candidate!.sdpMLineIndex));
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
if (kDebugMode) {
|
|
|
|
|
logger.i("res: " + items.toString());
|
|
|
|
|
}
|
|
|
|
|
@ -171,7 +195,7 @@ class ChatCallProvider with ChangeNotifier, DiagnosticableTreeMixin {
|
|
|
|
|
Navigator.push(
|
|
|
|
|
providerContext,
|
|
|
|
|
MaterialPageRoute(
|
|
|
|
|
builder: (BuildContext context) => StartCallPage(localRenderer: localVideoRenderer, remoteRenderer: remoteRenderer),
|
|
|
|
|
builder: (BuildContext context) => StartCallPage(),
|
|
|
|
|
allowSnapshotting: false,
|
|
|
|
|
)).then((value) {
|
|
|
|
|
Navigator.of(providerContext).pop();
|
|
|
|
|
@ -181,21 +205,34 @@ class ChatCallProvider with ChangeNotifier, DiagnosticableTreeMixin {
|
|
|
|
|
}
|
|
|
|
|
notifyListeners();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Future<void> onOfferAsync(List<Object?>? params) async {
|
|
|
|
|
// tempPayLoad = {"values": params!.toList()};
|
|
|
|
|
dynamic items = params!.toList();
|
|
|
|
|
var data = jsonDecode(items.toString());
|
|
|
|
|
if (isIncomingCall) {
|
|
|
|
|
_pc.setRemoteDescription(RTCSessionDescription(data[0]["sdp"]["sdp"], data[0]["sdp"]["type"]));
|
|
|
|
|
RTCSessionDescription description = await _createAnswer();
|
|
|
|
|
await _pc.setLocalDescription(description);
|
|
|
|
|
var payload = {"target": items[0]["id"], "caller": outGoingCallData.callerId, "sdp": description.toMap()};
|
|
|
|
|
invoke(invokeMethod: "AnswerOffer", currentUserID: outGoingCallData.callerId!, targetUserID: items[0]["id"], data: jsonEncode(payload));
|
|
|
|
|
var payload = {"target": data[0]["caller"], "caller": AppState().chatDetails!.response!.id, "sdp": description.toMap()};
|
|
|
|
|
invoke(invokeMethod: "AnswerOfferAsync", currentUserID: AppState().chatDetails!.response!.id!, targetUserID: incomingCallData.targetUserId!, data: jsonEncode(payload));
|
|
|
|
|
}
|
|
|
|
|
// else {
|
|
|
|
|
// RTCSessionDescription description = await _createAnswer();
|
|
|
|
|
// await _pc.setLocalDescription(description);
|
|
|
|
|
// var payload = {"target": items[0]["id"], "caller": outGoingCallData.callerId, "sdp": description.toMap()};
|
|
|
|
|
// invoke(invokeMethod: "AnswerOffer", currentUserID: outGoingCallData.callerId!, targetUserID: items[0]["id"], data: jsonEncode(payload));
|
|
|
|
|
// }
|
|
|
|
|
notifyListeners();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Incoming Listeners
|
|
|
|
|
|
|
|
|
|
void onAnswerOffer(List<Object?>? payload) async {
|
|
|
|
|
print("--------------------- On Answer Offer Async ---------------------------------------");
|
|
|
|
|
if (isIncomingCall) {
|
|
|
|
|
// print("--------------------- On Answer Offer Async ---------------------------------------");
|
|
|
|
|
//await invoke(invokeMethod: "InvokeMobile", currentUserID: AppState().getchatUserDetails!.response!.id!, targetUserID: incomingCallData.targetUserId!, debugData: {"On Answer Offer Async"});
|
|
|
|
|
} else {
|
|
|
|
|
var items = payload!.toList();
|
|
|
|
|
if (kDebugMode) {
|
|
|
|
|
logger.i("res: " + items.toString());
|
|
|
|
|
@ -204,6 +241,7 @@ class ChatCallProvider with ChangeNotifier, DiagnosticableTreeMixin {
|
|
|
|
|
RTCSessionDescription description = RTCSessionDescription(data.sdp!.sdp, 'answer');
|
|
|
|
|
_pc.setRemoteDescription(description);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void onHangUpAsync(List<Object?>? params) {
|
|
|
|
|
print("--------------------- onHangUp ---------------------------------------");
|
|
|
|
|
@ -217,37 +255,53 @@ class ChatCallProvider with ChangeNotifier, DiagnosticableTreeMixin {
|
|
|
|
|
print("--------------------- On Incoming Call ---------------------------------------");
|
|
|
|
|
dynamic items = params!.toList();
|
|
|
|
|
logger.d(items);
|
|
|
|
|
if (!isOnIncomingCallPage) {
|
|
|
|
|
Map<String, dynamic> json = {
|
|
|
|
|
"callerID": items[0]["id"],
|
|
|
|
|
"callerName": items[0]["userName"],
|
|
|
|
|
"callerEmail": items[0]["email"],
|
|
|
|
|
"callerTitle": items[0]["title"],
|
|
|
|
|
"callerPhone": null,
|
|
|
|
|
"receiverID": AppState().chatDetails!.response!.id,
|
|
|
|
|
"receiverName": AppState().chatDetails!.response!.userName,
|
|
|
|
|
"receiverEmail": AppState().chatDetails!.response!.email,
|
|
|
|
|
"receiverTitle": AppState().chatDetails!.response!.title,
|
|
|
|
|
"receiverPhone": AppState().chatDetails!.response!.phone,
|
|
|
|
|
"title": AppState().chatDetails!.response!.userName!.replaceAll(".", " "),
|
|
|
|
|
"callType": items[1] ? "Video" : "Audio",
|
|
|
|
|
};
|
|
|
|
|
CallDataModel callData = CallDataModel.fromJson(json);
|
|
|
|
|
await Navigator.push(
|
|
|
|
|
providerContext,
|
|
|
|
|
MaterialPageRoute(
|
|
|
|
|
builder: (BuildContext context) => IncomingCall(
|
|
|
|
|
isVideoCall: items[1] ? true : false,
|
|
|
|
|
outGoingCallData: callData,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
isOnIncomingCallPage = true;
|
|
|
|
|
}
|
|
|
|
|
// Map<String, dynamic> json = {
|
|
|
|
|
// "callerID": items[0]["id"],
|
|
|
|
|
// "callerName": items[0]["userName"],
|
|
|
|
|
// "callerEmail": items[0]["email"],
|
|
|
|
|
// "callerTitle": items[0]["title"],
|
|
|
|
|
// "callerPhone": null,
|
|
|
|
|
// "receiverID": AppState().chatDetails!.response!.id,
|
|
|
|
|
// "receiverName": AppState().chatDetails!.response!.userName,
|
|
|
|
|
// "receiverEmail": AppState().chatDetails!.response!.email,
|
|
|
|
|
// "receiverTitle": AppState().chatDetails!.response!.title,
|
|
|
|
|
// "receiverPhone": AppState().chatDetails!.response!.phone,
|
|
|
|
|
// "title": AppState().chatDetails!.response!.userName!.replaceAll(".", " "),
|
|
|
|
|
// "callType": items[1] ? "Video" : "Audio",
|
|
|
|
|
// };
|
|
|
|
|
// CallDataModel callData = CallDataModel.fromJson(json);
|
|
|
|
|
// ChatVoipCall().showCallkitIncoming(uuid: const Uuid().v4(), isOnline: true, incomingCallData: callData);
|
|
|
|
|
//
|
|
|
|
|
// if (!isOnIncomingCallPage) {
|
|
|
|
|
// Map<String, dynamic> json = {
|
|
|
|
|
// "callerID": items[0]["id"],
|
|
|
|
|
// "callerName": items[0]["userName"],
|
|
|
|
|
// "callerEmail": items[0]["email"],
|
|
|
|
|
// "callerTitle": items[0]["title"],
|
|
|
|
|
// "callerPhone": null,
|
|
|
|
|
// "receiverID": AppState().chatDetails!.response!.id,
|
|
|
|
|
// "receiverName": AppState().chatDetails!.response!.userName,
|
|
|
|
|
// "receiverEmail": AppState().chatDetails!.response!.email,
|
|
|
|
|
// "receiverTitle": AppState().chatDetails!.response!.title,
|
|
|
|
|
// "receiverPhone": AppState().chatDetails!.response!.phone,
|
|
|
|
|
// "title": AppState().chatDetails!.response!.userName!.replaceAll(".", " "),
|
|
|
|
|
// "callType": items[1] ? "Video" : "Audio",
|
|
|
|
|
// };
|
|
|
|
|
// CallDataModel callData = CallDataModel.fromJson(json);
|
|
|
|
|
// await Navigator.push(
|
|
|
|
|
// providerContext,
|
|
|
|
|
// MaterialPageRoute(
|
|
|
|
|
// builder: (BuildContext context) => IncomingCall(
|
|
|
|
|
// isVideoCall: items[1] ? true : false,
|
|
|
|
|
// outGoingCallData: callData,
|
|
|
|
|
// ),
|
|
|
|
|
// ),
|
|
|
|
|
// );
|
|
|
|
|
// isOnIncomingCallPage = true;
|
|
|
|
|
// }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void onCallDeclinedAsync(List<Object?>? params) {
|
|
|
|
|
print("--------------------- on Call Declined ---------------------------------------");
|
|
|
|
|
endCall().then((bool value) {
|
|
|
|
|
if (value) {
|
|
|
|
|
isCallEnded = true;
|
|
|
|
|
@ -258,7 +312,7 @@ class ChatCallProvider with ChangeNotifier, DiagnosticableTreeMixin {
|
|
|
|
|
|
|
|
|
|
//// Invoke Methods
|
|
|
|
|
|
|
|
|
|
Future<void> invoke({required String invokeMethod, required int currentUserID, required int targetUserID, var data, int userStatus = 1}) async {
|
|
|
|
|
Future<void> invoke({required String invokeMethod, required int currentUserID, required int targetUserID, var data, int userStatus = 1, var debugData}) async {
|
|
|
|
|
List<Object> args = [];
|
|
|
|
|
// Utils.showToast(currentUserID.toString() + " -- " + targetUserID.toString() + " -- " + isVideoCall.toString());
|
|
|
|
|
if (invokeMethod == "CallUserAsync") {
|
|
|
|
|
@ -276,8 +330,9 @@ class ChatCallProvider with ChangeNotifier, DiagnosticableTreeMixin {
|
|
|
|
|
args = [currentUserID, userStatus];
|
|
|
|
|
} else if (invokeMethod == "HangUpAsync") {
|
|
|
|
|
args = [currentUserID, targetUserID];
|
|
|
|
|
} else if (invokeMethod == "InvokeMobile") {
|
|
|
|
|
args = [debugData];
|
|
|
|
|
}
|
|
|
|
|
logger.d(args);
|
|
|
|
|
try {
|
|
|
|
|
await chatHubConnection.invoke("$invokeMethod", args: args);
|
|
|
|
|
} catch (e) {
|
|
|
|
|
@ -319,7 +374,9 @@ class ChatCallProvider with ChangeNotifier, DiagnosticableTreeMixin {
|
|
|
|
|
},
|
|
|
|
|
'optional': []
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
RTCPeerConnection pc = await createPeerConnection(configuration, offerSdpConstraints);
|
|
|
|
|
logger.w(pc.connectionState);
|
|
|
|
|
await pc!.addStream(localStream!);
|
|
|
|
|
pc?.onConnectionState = (RTCPeerConnectionState state) {};
|
|
|
|
|
pc?.onAddStream = (MediaStream stream) {
|
|
|
|
|
@ -327,10 +384,19 @@ class ChatCallProvider with ChangeNotifier, DiagnosticableTreeMixin {
|
|
|
|
|
notifyListeners();
|
|
|
|
|
};
|
|
|
|
|
pc!.onIceCandidate = (RTCIceCandidate e) async {
|
|
|
|
|
if (isIncomingCall) {
|
|
|
|
|
if (e.candidate != null) {
|
|
|
|
|
var payload = {"target": incomingCallData.targetUserId, "candidate": e.toMap()};
|
|
|
|
|
logger.i("Candidate:" + e.toMap().toString());
|
|
|
|
|
invoke(invokeMethod: "IceCandidateAsync", currentUserID: AppState().chatDetails!.response!.id!, targetUserID: incomingCallData.targetUserId!, data: jsonEncode(payload));
|
|
|
|
|
notifyListeners();
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
if (e.candidate != null) {
|
|
|
|
|
var payload = {"target": outGoingCallData.callerId, "candidate": e.toMap()};
|
|
|
|
|
logger.i("Candidate:" + e.toMap().toString());
|
|
|
|
|
await invoke(invokeMethod: "IceCandidateAsync", currentUserID: outGoingCallData.callerId!, targetUserID: outGoingCallData.receiverId!, data: jsonEncode(payload));
|
|
|
|
|
invoke(invokeMethod: "IceCandidateAsync", currentUserID: outGoingCallData.callerId!, targetUserID: outGoingCallData.receiverId!, data: jsonEncode(payload));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
// pc!.onTrack = (RTCTrackEvent event) async {
|
|
|
|
|
@ -345,12 +411,21 @@ class ChatCallProvider with ChangeNotifier, DiagnosticableTreeMixin {
|
|
|
|
|
// };
|
|
|
|
|
pc!.onSignalingState = (RTCSignalingState state) {
|
|
|
|
|
logger.i("signaling state: " + state.name);
|
|
|
|
|
invoke(
|
|
|
|
|
invokeMethod: "InvokeMobile",
|
|
|
|
|
currentUserID: AppState().getchatUserDetails!.response!.id!,
|
|
|
|
|
targetUserID: incomingCallData.targetUserId!,
|
|
|
|
|
debugData: {"location": "Signaling", "parms": state.name});
|
|
|
|
|
};
|
|
|
|
|
pc!.onIceGatheringState = (RTCIceGatheringState state) {
|
|
|
|
|
logger.i("rtc ice gathering state: " + state.name);
|
|
|
|
|
};
|
|
|
|
|
pc!.onIceConnectionState = (RTCIceConnectionState state) {
|
|
|
|
|
logger.i("rtc ice connection state: " + state.name);
|
|
|
|
|
// invoke(
|
|
|
|
|
// invokeMethod: "InvokeMobile",
|
|
|
|
|
// currentUserID: AppState().getchatUserDetails!.response!.id!,
|
|
|
|
|
// targetUserID: incomingCallData.targetUserId!,
|
|
|
|
|
// debugData: {"location": "onIceConnection", "parms": state.name});
|
|
|
|
|
};
|
|
|
|
|
pc!.onRenegotiationNeeded = () {};
|
|
|
|
|
return pc;
|
|
|
|
|
@ -376,13 +451,13 @@ class ChatCallProvider with ChangeNotifier, DiagnosticableTreeMixin {
|
|
|
|
|
|
|
|
|
|
Future<RTCSessionDescription> _createOffer() async {
|
|
|
|
|
RTCSessionDescription description = await _pc!.createOffer();
|
|
|
|
|
_offer = true;
|
|
|
|
|
// _offer = true;
|
|
|
|
|
return description;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Future<RTCSessionDescription> _createAnswer() async {
|
|
|
|
|
RTCSessionDescription description = await _pc!.createAnswer();
|
|
|
|
|
_offer = false;
|
|
|
|
|
// _offer = false;
|
|
|
|
|
return description;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -421,7 +496,6 @@ class ChatCallProvider with ChangeNotifier, DiagnosticableTreeMixin {
|
|
|
|
|
|
|
|
|
|
void switchCamera() {
|
|
|
|
|
isFrontCamera = !isFrontCamera;
|
|
|
|
|
print("================= Camera Switch Triggered ===================");
|
|
|
|
|
Helper.switchCamera(localStream.getVideoTracks()[0]);
|
|
|
|
|
notifyListeners();
|
|
|
|
|
}
|
|
|
|
|
@ -431,11 +505,22 @@ class ChatCallProvider with ChangeNotifier, DiagnosticableTreeMixin {
|
|
|
|
|
localStream = await navigator.mediaDevices.getUserMedia(isVideoCall ? videoConstraints : audioConstraints);
|
|
|
|
|
localVideoRenderer.srcObject = localStream;
|
|
|
|
|
await remoteRenderer.initialize();
|
|
|
|
|
_pc = await creatOfferWithCon();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Future<void> startIncomingCallViaKit() async {
|
|
|
|
|
Future<void> startIncomingCallViaKit({bool isVCall = true, required var inCallData}) async {
|
|
|
|
|
Utils.saveStringFromPrefs("isIncomingCall", "false");
|
|
|
|
|
isVideoCall = isVCall;
|
|
|
|
|
await startIncomingCall();
|
|
|
|
|
await invoke(invokeMethod: "answerCallAsync", currentUserID: inComingCallData.extra!.loginDetails!.id!, targetUserID: inComingCallData.extra!.callerDetails!.targetUserId!);
|
|
|
|
|
isIncomingCall = true;
|
|
|
|
|
dynamic callData = await jsonDecode(inCallData);
|
|
|
|
|
incomingCallData = SingleUserChatModel.fromJson(callData[0]["callerDetails"]);
|
|
|
|
|
notifyListeners();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void connectIncomingCall() {
|
|
|
|
|
invoke(invokeMethod: "answerCallAsync", currentUserID: AppState().getchatUserDetails!.response!.id!, targetUserID: incomingCallData.targetUserId!);
|
|
|
|
|
isIncomingCallLoader = false;
|
|
|
|
|
isVideoCall = true;
|
|
|
|
|
notifyListeners();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|