|
|
|
@ -38,13 +38,14 @@ class _ChatDetailScreenState extends State<ChatDetailScreen> {
|
|
|
|
void getMoreChat() async {
|
|
|
|
void getMoreChat() async {
|
|
|
|
if (userDetails != null) {
|
|
|
|
if (userDetails != null) {
|
|
|
|
data.paginationVal = data.paginationVal + 10;
|
|
|
|
data.paginationVal = data.paginationVal + 10;
|
|
|
|
if (userDetails != null)
|
|
|
|
if (userDetails != null) {
|
|
|
|
data.getSingleUserChatHistory(
|
|
|
|
data.getSingleUserChatHistory(
|
|
|
|
senderUID: AppState().chatDetails!.response!.id!.toInt(),
|
|
|
|
senderUID: AppState().chatDetails!.response!.id!.toInt(),
|
|
|
|
receiverUID: userDetails["targetUser"].id,
|
|
|
|
receiverUID: userDetails["targetUser"].id,
|
|
|
|
loadMore: true,
|
|
|
|
loadMore: true,
|
|
|
|
isNewChat: false,
|
|
|
|
isNewChat: false,
|
|
|
|
);
|
|
|
|
);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
await Future.delayed(
|
|
|
|
await Future.delayed(
|
|
|
|
const Duration(
|
|
|
|
const Duration(
|
|
|
|
@ -76,10 +77,10 @@ class _ChatDetailScreenState extends State<ChatDetailScreen> {
|
|
|
|
actions: [
|
|
|
|
actions: [
|
|
|
|
IconButton(
|
|
|
|
IconButton(
|
|
|
|
onPressed: () {
|
|
|
|
onPressed: () {
|
|
|
|
// makeCall(
|
|
|
|
makeCall(
|
|
|
|
// callType: "AUDIO",
|
|
|
|
callType: "AUDIO",
|
|
|
|
// con: data.hubConnection,
|
|
|
|
con: data.hubConnection,
|
|
|
|
// );
|
|
|
|
);
|
|
|
|
},
|
|
|
|
},
|
|
|
|
icon: SvgPicture.asset(
|
|
|
|
icon: SvgPicture.asset(
|
|
|
|
"assets/icons/chat/call.svg",
|
|
|
|
"assets/icons/chat/call.svg",
|
|
|
|
@ -89,10 +90,10 @@ class _ChatDetailScreenState extends State<ChatDetailScreen> {
|
|
|
|
),
|
|
|
|
),
|
|
|
|
IconButton(
|
|
|
|
IconButton(
|
|
|
|
onPressed: () {
|
|
|
|
onPressed: () {
|
|
|
|
// makeCall(
|
|
|
|
makeCall(
|
|
|
|
// callType: "VIDEO",
|
|
|
|
callType: "VIDEO",
|
|
|
|
// con: data.hubConnection,
|
|
|
|
con: data.hubConnection,
|
|
|
|
// );
|
|
|
|
);
|
|
|
|
},
|
|
|
|
},
|
|
|
|
icon: SvgPicture.asset(
|
|
|
|
icon: SvgPicture.asset(
|
|
|
|
"assets/icons/chat/video_call.svg",
|
|
|
|
"assets/icons/chat/video_call.svg",
|
|
|
|
@ -357,38 +358,41 @@ class _ChatDetailScreenState extends State<ChatDetailScreen> {
|
|
|
|
|
|
|
|
|
|
|
|
void makeCall({required String callType, required HubConnection con}) async {
|
|
|
|
void makeCall({required String callType, required HubConnection con}) async {
|
|
|
|
print("================== Make call Triggered ============================");
|
|
|
|
print("================== Make call Triggered ============================");
|
|
|
|
logger.d(jsonEncode(AppState().chatDetails!.response));
|
|
|
|
|
|
|
|
Map<String, dynamic> json = {
|
|
|
|
Map<String, dynamic> json = {
|
|
|
|
"callerID": AppState().chatDetails!.response!.id!.toString(),
|
|
|
|
"callerID": AppState().chatDetails!.response!.id!.toString(),
|
|
|
|
"callReciverID": userDetails["targetUser"].id.toString(),
|
|
|
|
"callReceiverID": userDetails["targetUser"].id.toString(),
|
|
|
|
"notification_foreground": "true",
|
|
|
|
"notification_foreground": "true",
|
|
|
|
"message": "Aamir is calling ",
|
|
|
|
"message": "Aamir is calling",
|
|
|
|
"title": "Video Call",
|
|
|
|
"title": "Video Call",
|
|
|
|
"type": callType == "VIDEO" ? "Video" : "Audio",
|
|
|
|
"type": callType == "VIDEO" ? "Video" : "Audio",
|
|
|
|
"identity": "Aamir.Muhammad",
|
|
|
|
"identity": AppState().chatDetails!.response!.userName,
|
|
|
|
"name": "Aamir Saleem Ahmad",
|
|
|
|
"name": AppState().chatDetails!.response!.title,
|
|
|
|
"is_call": "true",
|
|
|
|
"is_call": "true",
|
|
|
|
"is_webrtc": "true",
|
|
|
|
"is_webrtc": "true",
|
|
|
|
"contant": "Start video Call Aamir.Muhammad",
|
|
|
|
"contant": "Start video Call ${AppState().chatDetails!.response!.userName}",
|
|
|
|
"contantNo": "775d1f11-62d9-6fcc-91f6-21f8c14559fb",
|
|
|
|
"contantNo": "775d1f11-62d9-6fcc-91f6-21f8c14559fb",
|
|
|
|
"chatEventId": "3",
|
|
|
|
"chatEventId": "3",
|
|
|
|
"fileTypeId": null,
|
|
|
|
"fileTypeId": null,
|
|
|
|
"currentUserId": "266642",
|
|
|
|
"currentUserId": AppState().chatDetails!.response!.id!.toString(),
|
|
|
|
"chatSource": "1",
|
|
|
|
"chatSource": "1",
|
|
|
|
"userChatHistoryLineRequestList": [
|
|
|
|
"userChatHistoryLineRequestList": [
|
|
|
|
{"isSeen": false, "isDelivered": false, "targetUserId": 341682, "targetUserStatus": 4}
|
|
|
|
{
|
|
|
|
|
|
|
|
"isSeen": false,
|
|
|
|
|
|
|
|
"isDelivered": false,
|
|
|
|
|
|
|
|
"targetUserId": userDetails["targetUser"].id,
|
|
|
|
|
|
|
|
"targetUserStatus": 4,
|
|
|
|
|
|
|
|
}
|
|
|
|
],
|
|
|
|
],
|
|
|
|
// "server": "https://192.168.8.163:8086",
|
|
|
|
// "server": "https://192.168.8.163:8086",
|
|
|
|
"server": "https://livecareturn.hmg.com:8086",
|
|
|
|
"server": "https://livecareturn.hmg.com:8086",
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
CallDataModel callData = CallDataModel.fromJson(json);
|
|
|
|
CallDataModel incomingCallData = CallDataModel.fromJson(json);
|
|
|
|
|
|
|
|
await Navigator.push(
|
|
|
|
await Navigator.push(
|
|
|
|
context,
|
|
|
|
context,
|
|
|
|
MaterialPageRoute(
|
|
|
|
MaterialPageRoute(
|
|
|
|
builder: (BuildContext context) => OutGoingCall(
|
|
|
|
builder: (BuildContext context) => OutGoingCall(
|
|
|
|
isVideoCall: callType == "VIDEO" ? true : false,
|
|
|
|
isVideoCall: callType == "VIDEO" ? true : false,
|
|
|
|
OutGoingCallData: incomingCallData,
|
|
|
|
OutGoingCallData: callData,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
);
|
|
|
|
|