|
|
@ -1,4 +1,5 @@
|
|
|
|
import 'dart:async';
|
|
|
|
import 'dart:async';
|
|
|
|
|
|
|
|
import 'dart:convert';
|
|
|
|
|
|
|
|
|
|
|
|
import 'package:easy_localization/easy_localization.dart';
|
|
|
|
import 'package:easy_localization/easy_localization.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
@ -9,6 +10,7 @@ import 'package:mohem_flutter_app/extensions/int_extensions.dart';
|
|
|
|
import 'package:mohem_flutter_app/extensions/string_extensions.dart';
|
|
|
|
import 'package:mohem_flutter_app/extensions/string_extensions.dart';
|
|
|
|
import 'package:mohem_flutter_app/extensions/widget_extensions.dart';
|
|
|
|
import 'package:mohem_flutter_app/extensions/widget_extensions.dart';
|
|
|
|
import 'package:mohem_flutter_app/generated/locale_keys.g.dart';
|
|
|
|
import 'package:mohem_flutter_app/generated/locale_keys.g.dart';
|
|
|
|
|
|
|
|
import 'package:mohem_flutter_app/main.dart';
|
|
|
|
import 'package:mohem_flutter_app/models/chat/call.dart';
|
|
|
|
import 'package:mohem_flutter_app/models/chat/call.dart';
|
|
|
|
import 'package:mohem_flutter_app/provider/chat_provider_model.dart';
|
|
|
|
import 'package:mohem_flutter_app/provider/chat_provider_model.dart';
|
|
|
|
import 'package:mohem_flutter_app/ui/chat/call/chat_outgoing_call_screen.dart';
|
|
|
|
import 'package:mohem_flutter_app/ui/chat/call/chat_outgoing_call_screen.dart';
|
|
|
@ -74,21 +76,14 @@ class _ChatDetailScreenState extends State<ChatDetailScreen> {
|
|
|
|
showHomeButton: false,
|
|
|
|
showHomeButton: false,
|
|
|
|
image: userDetails["targetUser"].image,
|
|
|
|
image: userDetails["targetUser"].image,
|
|
|
|
actions: [
|
|
|
|
actions: [
|
|
|
|
IconButton(
|
|
|
|
SvgPicture.asset("assets/icons/chat/call.svg", width: 21, height: 23).onPress(() {
|
|
|
|
constraints: const BoxConstraints(),
|
|
|
|
// makeCall(callType: "AUDIO", con: hubConnection);
|
|
|
|
onPressed: () {
|
|
|
|
}),
|
|
|
|
// makeCall(callType: "AUDIO", con: hubConnection);
|
|
|
|
24.width,
|
|
|
|
},
|
|
|
|
SvgPicture.asset("assets/icons/chat/video_call.svg", width: 21, height: 18).onPress(() {
|
|
|
|
icon: SvgPicture.asset("assets/icons/chat/call.svg", width: 22, height: 22),
|
|
|
|
// makeCall(callType: "VIDEO", con: hubConnection);
|
|
|
|
),
|
|
|
|
}),
|
|
|
|
IconButton(
|
|
|
|
21.width,
|
|
|
|
constraints: const BoxConstraints(),
|
|
|
|
|
|
|
|
onPressed: () {
|
|
|
|
|
|
|
|
//makeCall(callType: "VIDEO", con: hubConnection);
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
icon: SvgPicture.asset("assets/icons/chat/video_call.svg", width: 20, height: 20),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
10.width,
|
|
|
|
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
body: Consumer<ChatProviderModel>(
|
|
|
|
body: Consumer<ChatProviderModel>(
|
|
|
@ -128,13 +123,17 @@ class _ChatDetailScreenState extends State<ChatDetailScreen> {
|
|
|
|
dateTime: m.dateFormte(m.userChatHistory[i].createdDate!),
|
|
|
|
dateTime: m.dateFormte(m.userChatHistory[i].createdDate!),
|
|
|
|
isReplied: m.userChatHistory[i].userChatReplyResponse != null ? true : false,
|
|
|
|
isReplied: m.userChatHistory[i].userChatReplyResponse != null ? true : false,
|
|
|
|
userName: AppState().chatDetails!.response!.userName == m.userChatHistory[i].currentUserName.toString() ? "You" : m.userChatHistory[i].currentUserName.toString(),
|
|
|
|
userName: AppState().chatDetails!.response!.userName == m.userChatHistory[i].currentUserName.toString() ? "You" : m.userChatHistory[i].currentUserName.toString(),
|
|
|
|
|
|
|
|
fileTypeID: m.userChatHistory[i].fileTypeId,
|
|
|
|
|
|
|
|
fileTypeDescription: m.userChatHistory[i].fileTypeResponse!.fileTypeDescription,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
onRightSwipe: () {
|
|
|
|
onRightSwipe: () {
|
|
|
|
m.chatReply(
|
|
|
|
m.chatReply(
|
|
|
|
m.userChatHistory[i],
|
|
|
|
m.userChatHistory[i],
|
|
|
|
);
|
|
|
|
);
|
|
|
|
},
|
|
|
|
},
|
|
|
|
);
|
|
|
|
).onPress(() {
|
|
|
|
|
|
|
|
logger.d(jsonEncode(m.userChatHistory[i]));
|
|
|
|
|
|
|
|
});
|
|
|
|
},
|
|
|
|
},
|
|
|
|
),
|
|
|
|
),
|
|
|
|
).expanded,
|
|
|
|
).expanded,
|
|
|
@ -181,12 +180,12 @@ class _ChatDetailScreenState extends State<ChatDetailScreen> {
|
|
|
|
disabledBorder: InputBorder.none,
|
|
|
|
disabledBorder: InputBorder.none,
|
|
|
|
filled: true,
|
|
|
|
filled: true,
|
|
|
|
fillColor: MyColors.white,
|
|
|
|
fillColor: MyColors.white,
|
|
|
|
contentPadding: EdgeInsets.only(
|
|
|
|
contentPadding: const EdgeInsets.only(
|
|
|
|
left: 21,
|
|
|
|
left: 21,
|
|
|
|
top: 20,
|
|
|
|
top: 20,
|
|
|
|
bottom: 20,
|
|
|
|
bottom: 20,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
prefixIconConstraints: BoxConstraints(),
|
|
|
|
prefixIconConstraints: const BoxConstraints(),
|
|
|
|
prefixIcon: m.sFileType.isNotEmpty
|
|
|
|
prefixIcon: m.sFileType.isNotEmpty
|
|
|
|
? SvgPicture.asset(m.getType(m.sFileType), height: 30, width: 22, alignment: Alignment.center, fit: BoxFit.cover).paddingOnly(left: 21, right: 15)
|
|
|
|
? SvgPicture.asset(m.getType(m.sFileType), height: 30, width: 22, alignment: Alignment.center, fit: BoxFit.cover).paddingOnly(left: 21, right: 15)
|
|
|
|
: null,
|
|
|
|
: null,
|
|
|
|