|
|
|
|
@ -34,15 +34,11 @@ class ChatView extends StatelessWidget {
|
|
|
|
|
isScrollControlled: true,
|
|
|
|
|
enableDrag: true,
|
|
|
|
|
builder: (BuildContext context) {
|
|
|
|
|
return Consumer(builder:
|
|
|
|
|
(BuildContext context, RequestsVM requestsVM, Widget? child) {
|
|
|
|
|
return Consumer(builder: (BuildContext context, RequestsVM requestsVM, Widget? child) {
|
|
|
|
|
return InfoBottomSheet(
|
|
|
|
|
title: LocaleKeys.makeAnOffer
|
|
|
|
|
.tr()
|
|
|
|
|
.toText(fontSize: 28, isBold: true, letterSpacing: -1.44),
|
|
|
|
|
title: LocaleKeys.makeAnOffer.tr().toText(fontSize: 28, isBold: true, letterSpacing: -1.44),
|
|
|
|
|
description: Padding(
|
|
|
|
|
padding: EdgeInsets.only(
|
|
|
|
|
bottom: MediaQuery.of(context).viewInsets.bottom),
|
|
|
|
|
padding: EdgeInsets.only(bottom: MediaQuery.of(context).viewInsets.bottom),
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
@ -64,8 +60,7 @@ class ChatView extends StatelessWidget {
|
|
|
|
|
errorValue: requestsVM.offerDescriptionError,
|
|
|
|
|
keyboardType: TextInputType.text,
|
|
|
|
|
hint: LocaleKeys.description.tr(),
|
|
|
|
|
onChanged: (v) =>
|
|
|
|
|
requestsVM.updateOfferDescription(v),
|
|
|
|
|
onChanged: (v) => requestsVM.updateOfferDescription(v),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
@ -99,29 +94,21 @@ class ChatView extends StatelessWidget {
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
return Scaffold(
|
|
|
|
|
appBar: CustomAppBar(title: LocaleKeys.chat.tr()),
|
|
|
|
|
body: Consumer2<ChatVM, RequestsVM>(builder: (BuildContext context,
|
|
|
|
|
ChatVM chatVM, RequestsVM requestVM, Widget? child) {
|
|
|
|
|
body: Consumer2<ChatVM, RequestsVM>(builder: (BuildContext context, ChatVM chatVM, RequestsVM requestVM, Widget? child) {
|
|
|
|
|
final chatMessages = AppState().currentAppType == AppType.customer
|
|
|
|
|
? chatVM.serviceProviderOffersList[chatViewArguments.providerIndex]
|
|
|
|
|
.chatMessages
|
|
|
|
|
: requestVM.myFilteredRequests[chatViewArguments.requestIndex]
|
|
|
|
|
.chatMessages;
|
|
|
|
|
? chatVM.serviceProviderOffersList[chatViewArguments.providerIndex].chatMessages
|
|
|
|
|
: requestVM.myFilteredRequests[chatViewArguments.requestIndex].chatMessages;
|
|
|
|
|
return chatMessages == null
|
|
|
|
|
? Center(
|
|
|
|
|
child: LocaleKeys.noRequestsShow
|
|
|
|
|
.tr()
|
|
|
|
|
.toText(fontSize: 16, color: MyColors.lightTextColor))
|
|
|
|
|
? Center(child: LocaleKeys.noRequestsShow.tr().toText(fontSize: 16, color: MyColors.lightTextColor))
|
|
|
|
|
: Column(
|
|
|
|
|
children: [
|
|
|
|
|
Expanded(
|
|
|
|
|
child: ListView.separated(
|
|
|
|
|
itemCount: chatMessages.length,
|
|
|
|
|
separatorBuilder: (BuildContext context, int index) =>
|
|
|
|
|
20.height,
|
|
|
|
|
separatorBuilder: (BuildContext context, int index) => 20.height,
|
|
|
|
|
itemBuilder: (BuildContext context, int index) {
|
|
|
|
|
ChatMessageModel chatMessageModel = chatMessages[index];
|
|
|
|
|
return ChatMessageCustomWidget(
|
|
|
|
|
chatMessageModel: chatMessageModel);
|
|
|
|
|
return ChatMessageCustomWidget(chatMessageModel: chatMessageModel);
|
|
|
|
|
},
|
|
|
|
|
).horPaddingMain(),
|
|
|
|
|
),
|
|
|
|
|
@ -129,54 +116,64 @@ class ChatView extends StatelessWidget {
|
|
|
|
|
Row(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
|
children: [
|
|
|
|
|
if (AppState().currentAppType == AppType.provider) ...[
|
|
|
|
|
if (requestVM.currentSelectedRequest!.requestStatus == RequestStatus.inProgress) ...[
|
|
|
|
|
Center(
|
|
|
|
|
child: LocaleKeys.requestAlreadyInProgress.tr().toText(
|
|
|
|
|
textAlign: TextAlign.center,
|
|
|
|
|
color: MyColors.lightTextColor,
|
|
|
|
|
fontSize: 14,
|
|
|
|
|
),
|
|
|
|
|
).paddingAll(15)
|
|
|
|
|
] else ...[
|
|
|
|
|
if (AppState().currentAppType == AppType.provider) ...[
|
|
|
|
|
Expanded(
|
|
|
|
|
flex: 1,
|
|
|
|
|
child: const Icon(
|
|
|
|
|
Icons.local_offer_rounded,
|
|
|
|
|
color: MyColors.darkPrimaryColor,
|
|
|
|
|
size: 30,
|
|
|
|
|
).onPress(
|
|
|
|
|
() async {
|
|
|
|
|
buildSendOfferBottomSheet(context);
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
Expanded(
|
|
|
|
|
flex: 8,
|
|
|
|
|
child: TxtField(
|
|
|
|
|
value: chatVM.chatMessageText,
|
|
|
|
|
hint: LocaleKeys.typeMessageHere.tr(),
|
|
|
|
|
keyboardType: TextInputType.text,
|
|
|
|
|
isNeedBorder: false,
|
|
|
|
|
onChanged: (v) => chatVM.updateChatMessageText(v),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Expanded(
|
|
|
|
|
flex: 1,
|
|
|
|
|
child: const Icon(
|
|
|
|
|
Icons.local_offer_rounded,
|
|
|
|
|
Icons.send_rounded,
|
|
|
|
|
color: MyColors.darkPrimaryColor,
|
|
|
|
|
size: 30,
|
|
|
|
|
).onPress(
|
|
|
|
|
() async {
|
|
|
|
|
buildSendOfferBottomSheet(context);
|
|
|
|
|
log("chatViewArguments.requestId:${chatViewArguments.requestId}");
|
|
|
|
|
final status = await chatVM.onTextMessageSend(
|
|
|
|
|
context: context,
|
|
|
|
|
receiverId: chatViewArguments.receiverId,
|
|
|
|
|
message: chatVM.chatMessageText,
|
|
|
|
|
requestId: chatViewArguments.requestId ?? 0,
|
|
|
|
|
offerPrice: "0.0",
|
|
|
|
|
chatMessageType: ChatMessageTypeEnum.freeText,
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
if (status) {
|
|
|
|
|
chatVM.clearChatMessageText();
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
Expanded(
|
|
|
|
|
flex: 8,
|
|
|
|
|
child: TxtField(
|
|
|
|
|
value: chatVM.chatMessageText,
|
|
|
|
|
hint: LocaleKeys.typeMessageHere.tr(),
|
|
|
|
|
keyboardType: TextInputType.text,
|
|
|
|
|
isNeedBorder: false,
|
|
|
|
|
onChanged: (v) => chatVM.updateChatMessageText(v),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Expanded(
|
|
|
|
|
flex: 1,
|
|
|
|
|
child: const Icon(
|
|
|
|
|
Icons.send_rounded,
|
|
|
|
|
color: MyColors.darkPrimaryColor,
|
|
|
|
|
size: 30,
|
|
|
|
|
).onPress(
|
|
|
|
|
() async {
|
|
|
|
|
log("chatViewArguments.requestId:${chatViewArguments.requestId}");
|
|
|
|
|
final status = await chatVM.onTextMessageSend(
|
|
|
|
|
context: context,
|
|
|
|
|
receiverId: chatViewArguments.receiverId,
|
|
|
|
|
message: chatVM.chatMessageText,
|
|
|
|
|
requestId: chatViewArguments.requestId ?? 0,
|
|
|
|
|
offerPrice: "0.0",
|
|
|
|
|
chatMessageType: ChatMessageTypeEnum.freeText,
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
if (status) {
|
|
|
|
|
chatVM.clearChatMessageText();
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
).toContainer(isShadowEnabled: true),
|
|
|
|
|
],
|
|
|
|
|
@ -193,8 +190,7 @@ class ChatMessageCustomWidget extends StatefulWidget {
|
|
|
|
|
const ChatMessageCustomWidget({super.key, required this.chatMessageModel});
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
State<ChatMessageCustomWidget> createState() =>
|
|
|
|
|
_ChatMessageCustomWidgetState();
|
|
|
|
|
State<ChatMessageCustomWidget> createState() => _ChatMessageCustomWidgetState();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
class _ChatMessageCustomWidgetState extends State<ChatMessageCustomWidget> {
|
|
|
|
|
@ -204,15 +200,11 @@ class _ChatMessageCustomWidgetState extends State<ChatMessageCustomWidget> {
|
|
|
|
|
isScrollControlled: true,
|
|
|
|
|
enableDrag: true,
|
|
|
|
|
builder: (BuildContext context) {
|
|
|
|
|
return Consumer(
|
|
|
|
|
builder: (BuildContext context, ChatVM chatVM, Widget? child) {
|
|
|
|
|
return Consumer(builder: (BuildContext context, ChatVM chatVM, Widget? child) {
|
|
|
|
|
return InfoBottomSheet(
|
|
|
|
|
title: LocaleKeys.makeAnOffer
|
|
|
|
|
.tr()
|
|
|
|
|
.toText(fontSize: 28, isBold: true, letterSpacing: -1.44),
|
|
|
|
|
title: LocaleKeys.makeAnOffer.tr().toText(fontSize: 28, isBold: true, letterSpacing: -1.44),
|
|
|
|
|
description: Padding(
|
|
|
|
|
padding: EdgeInsets.only(
|
|
|
|
|
bottom: MediaQuery.of(context).viewInsets.bottom),
|
|
|
|
|
padding: EdgeInsets.only(bottom: MediaQuery.of(context).viewInsets.bottom),
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
@ -223,18 +215,14 @@ class _ChatMessageCustomWidgetState extends State<ChatMessageCustomWidget> {
|
|
|
|
|
ListView.separated(
|
|
|
|
|
shrinkWrap: true,
|
|
|
|
|
itemCount: chatVM.offerRejectModelList.length,
|
|
|
|
|
separatorBuilder: (BuildContext context, int index) =>
|
|
|
|
|
const Divider(thickness: 0.5),
|
|
|
|
|
separatorBuilder: (BuildContext context, int index) => const Divider(thickness: 0.5),
|
|
|
|
|
itemBuilder: (BuildContext context, int index) {
|
|
|
|
|
OfferRequestCommentModel offerRequestCommentModel =
|
|
|
|
|
chatVM.offerRejectModelList[index];
|
|
|
|
|
OfferRequestCommentModel offerRequestCommentModel = chatVM.offerRejectModelList[index];
|
|
|
|
|
return CircleCheckBoxWithTitle(
|
|
|
|
|
isChecked:
|
|
|
|
|
offerRequestCommentModel.isSelected ?? false,
|
|
|
|
|
isChecked: offerRequestCommentModel.isSelected ?? false,
|
|
|
|
|
title: '${offerRequestCommentModel.title}',
|
|
|
|
|
onSelected: () {
|
|
|
|
|
chatVM.updateSelectionInOfferRejectModelList(
|
|
|
|
|
index);
|
|
|
|
|
chatVM.updateSelectionInOfferRejectModelList(index);
|
|
|
|
|
},
|
|
|
|
|
selectedColor: MyColors.darkPrimaryColor,
|
|
|
|
|
);
|
|
|
|
|
@ -247,8 +235,7 @@ class _ChatMessageCustomWidgetState extends State<ChatMessageCustomWidget> {
|
|
|
|
|
errorValue: chatVM.rejectOfferDescriptionError,
|
|
|
|
|
keyboardType: TextInputType.text,
|
|
|
|
|
hint: LocaleKeys.description.tr(),
|
|
|
|
|
onChanged: (v) =>
|
|
|
|
|
chatVM.updateRejectOfferDescription(v),
|
|
|
|
|
onChanged: (v) => chatVM.updateRejectOfferDescription(v),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
@ -267,12 +254,8 @@ class _ChatMessageCustomWidgetState extends State<ChatMessageCustomWidget> {
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Widget buildOfferDetailsInChatMessage(
|
|
|
|
|
{required ChatMessageModel chatMessageModel,
|
|
|
|
|
required BuildContext context}) {
|
|
|
|
|
final requestOfferStatusEnum =
|
|
|
|
|
chatMessageModel.reqOffer!.requestOfferStatusEnum ??
|
|
|
|
|
RequestOfferStatusEnum.offer;
|
|
|
|
|
Widget buildOfferDetailsInChatMessage({required ChatMessageModel chatMessageModel, required BuildContext context}) {
|
|
|
|
|
final requestOfferStatusEnum = chatMessageModel.reqOffer!.requestOfferStatusEnum ?? RequestOfferStatusEnum.offer;
|
|
|
|
|
|
|
|
|
|
switch (requestOfferStatusEnum) {
|
|
|
|
|
case RequestOfferStatusEnum.offer:
|
|
|
|
|
@ -282,18 +265,9 @@ class _ChatMessageCustomWidgetState extends State<ChatMessageCustomWidget> {
|
|
|
|
|
Row(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.end,
|
|
|
|
|
children: [
|
|
|
|
|
"${chatMessageModel.reqOffer!.price}".toText(
|
|
|
|
|
fontSize: 19,
|
|
|
|
|
isBold: true,
|
|
|
|
|
color: AppState().currentAppType == AppType.provider
|
|
|
|
|
? MyColors.white
|
|
|
|
|
: MyColors.darkTextColor),
|
|
|
|
|
"${chatMessageModel.reqOffer!.price}".toText(fontSize: 19, isBold: true, color: AppState().currentAppType == AppType.provider ? MyColors.white : MyColors.darkTextColor),
|
|
|
|
|
5.width,
|
|
|
|
|
LocaleKeys.sar.tr().toText(
|
|
|
|
|
color: MyColors.lightTextColor,
|
|
|
|
|
height: 2.2,
|
|
|
|
|
fontSize: 10,
|
|
|
|
|
isBold: true),
|
|
|
|
|
LocaleKeys.sar.tr().toText(color: MyColors.lightTextColor, height: 2.2, fontSize: 10, isBold: true),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
if (widget.chatMessageModel.isMyMessage == false) ...[
|
|
|
|
|
@ -308,19 +282,15 @@ class _ChatMessageCustomWidgetState extends State<ChatMessageCustomWidget> {
|
|
|
|
|
borderColor: MyColors.greenColor,
|
|
|
|
|
isFilled: false,
|
|
|
|
|
onPressed: () async {
|
|
|
|
|
int status =
|
|
|
|
|
await context.read<ChatVM>().onActionOfferTapped(
|
|
|
|
|
context: context,
|
|
|
|
|
requestOfferStatusEnum:
|
|
|
|
|
RequestOfferStatusEnum.accepted,
|
|
|
|
|
reqOfferId: chatMessageModel.reqOfferID ?? -1,
|
|
|
|
|
);
|
|
|
|
|
int status = await context.read<ChatVM>().onActionOfferTapped(
|
|
|
|
|
context: context,
|
|
|
|
|
requestOfferStatusEnum: RequestOfferStatusEnum.accepted,
|
|
|
|
|
reqOfferId: chatMessageModel.reqOfferID ?? -1,
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
if (status != -1) {
|
|
|
|
|
log("accepted: $status");
|
|
|
|
|
if (chatMessageModel.reqOfferID == status) {
|
|
|
|
|
chatMessageModel.reqOffer!.requestOfferStatusEnum =
|
|
|
|
|
RequestOfferStatusEnum.accepted;
|
|
|
|
|
chatMessageModel.reqOffer!.requestOfferStatusEnum = RequestOfferStatusEnum.accepted;
|
|
|
|
|
setState(() {});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@ -358,11 +328,7 @@ class _ChatMessageCustomWidgetState extends State<ChatMessageCustomWidget> {
|
|
|
|
|
fontSize: 12,
|
|
|
|
|
isItalic: true,
|
|
|
|
|
),
|
|
|
|
|
).toContainer(
|
|
|
|
|
borderRadius: 40,
|
|
|
|
|
width: double.infinity,
|
|
|
|
|
backgroundColor:
|
|
|
|
|
MyColors.adPendingStatusColor.withOpacity(0.16)),
|
|
|
|
|
).toContainer(borderRadius: 40, width: double.infinity, backgroundColor: MyColors.adPendingStatusColor.withOpacity(0.16)),
|
|
|
|
|
],
|
|
|
|
|
);
|
|
|
|
|
case RequestOfferStatusEnum.accepted:
|
|
|
|
|
@ -374,11 +340,7 @@ class _ChatMessageCustomWidgetState extends State<ChatMessageCustomWidget> {
|
|
|
|
|
fontSize: 12,
|
|
|
|
|
isItalic: true,
|
|
|
|
|
),
|
|
|
|
|
).toContainer(
|
|
|
|
|
borderRadius: 40,
|
|
|
|
|
width: double.infinity,
|
|
|
|
|
backgroundColor:
|
|
|
|
|
MyColors.adPendingStatusColor.withOpacity(0.16)),
|
|
|
|
|
).toContainer(borderRadius: 40, width: double.infinity, backgroundColor: MyColors.adPendingStatusColor.withOpacity(0.16)),
|
|
|
|
|
],
|
|
|
|
|
);
|
|
|
|
|
case RequestOfferStatusEnum.rejected:
|
|
|
|
|
@ -390,11 +352,7 @@ class _ChatMessageCustomWidgetState extends State<ChatMessageCustomWidget> {
|
|
|
|
|
fontSize: 12,
|
|
|
|
|
isItalic: true,
|
|
|
|
|
),
|
|
|
|
|
).toContainer(
|
|
|
|
|
borderRadius: 40,
|
|
|
|
|
width: double.infinity,
|
|
|
|
|
backgroundColor:
|
|
|
|
|
MyColors.adPendingStatusColor.withOpacity(0.16)),
|
|
|
|
|
).toContainer(borderRadius: 40, width: double.infinity, backgroundColor: MyColors.adPendingStatusColor.withOpacity(0.16)),
|
|
|
|
|
],
|
|
|
|
|
);
|
|
|
|
|
case RequestOfferStatusEnum.cancel:
|
|
|
|
|
@ -406,11 +364,7 @@ class _ChatMessageCustomWidgetState extends State<ChatMessageCustomWidget> {
|
|
|
|
|
fontSize: 12,
|
|
|
|
|
isItalic: true,
|
|
|
|
|
),
|
|
|
|
|
).toContainer(
|
|
|
|
|
borderRadius: 40,
|
|
|
|
|
width: double.infinity,
|
|
|
|
|
backgroundColor:
|
|
|
|
|
MyColors.adPendingStatusColor.withOpacity(0.16)),
|
|
|
|
|
).toContainer(borderRadius: 40, width: double.infinity, backgroundColor: MyColors.adPendingStatusColor.withOpacity(0.16)),
|
|
|
|
|
],
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
@ -419,9 +373,7 @@ class _ChatMessageCustomWidgetState extends State<ChatMessageCustomWidget> {
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
return Directionality(
|
|
|
|
|
textDirection: (widget.chatMessageModel.isMyMessage ?? false)
|
|
|
|
|
? TextDirection.rtl
|
|
|
|
|
: TextDirection.ltr,
|
|
|
|
|
textDirection: (widget.chatMessageModel.isMyMessage ?? false) ? TextDirection.rtl : TextDirection.ltr,
|
|
|
|
|
child: Row(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
@ -443,10 +395,7 @@ class _ChatMessageCustomWidgetState extends State<ChatMessageCustomWidget> {
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
((widget.chatMessageModel.isMyMessage ?? false)
|
|
|
|
|
? "You"
|
|
|
|
|
: widget.chatMessageModel.senderName ?? "")
|
|
|
|
|
.toText(fontSize: 16, isBold: true),
|
|
|
|
|
((widget.chatMessageModel.isMyMessage ?? false) ? "You" : widget.chatMessageModel.senderName ?? "").toText(fontSize: 16, isBold: true),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
5.height,
|
|
|
|
|
@ -458,13 +407,8 @@ class _ChatMessageCustomWidgetState extends State<ChatMessageCustomWidget> {
|
|
|
|
|
Expanded(
|
|
|
|
|
child: Directionality(
|
|
|
|
|
textDirection: TextDirection.ltr,
|
|
|
|
|
child:
|
|
|
|
|
(widget.chatMessageModel.chatText ?? "").toText(
|
|
|
|
|
color:
|
|
|
|
|
(widget.chatMessageModel.isMyMessage ?? false)
|
|
|
|
|
? MyColors.white
|
|
|
|
|
: MyColors.lightTextColor,
|
|
|
|
|
|
|
|
|
|
child: (widget.chatMessageModel.chatText ?? "").toText(
|
|
|
|
|
color: (widget.chatMessageModel.isMyMessage ?? false) ? MyColors.white : MyColors.lightTextColor,
|
|
|
|
|
fontSize: 12,
|
|
|
|
|
// isBold: true,
|
|
|
|
|
),
|
|
|
|
|
@ -472,26 +416,15 @@ class _ChatMessageCustomWidgetState extends State<ChatMessageCustomWidget> {
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
if (widget.chatMessageModel.chatMessageTypeEnum ==
|
|
|
|
|
ChatMessageTypeEnum.offer) ...[
|
|
|
|
|
buildOfferDetailsInChatMessage(
|
|
|
|
|
chatMessageModel: widget.chatMessageModel,
|
|
|
|
|
context: context),
|
|
|
|
|
if (widget.chatMessageModel.chatMessageTypeEnum == ChatMessageTypeEnum.offer) ...[
|
|
|
|
|
buildOfferDetailsInChatMessage(chatMessageModel: widget.chatMessageModel, context: context),
|
|
|
|
|
],
|
|
|
|
|
],
|
|
|
|
|
).toContainer(
|
|
|
|
|
isShadowEnabled:
|
|
|
|
|
!(widget.chatMessageModel.isMyMessage ?? false),
|
|
|
|
|
backgroundColor:
|
|
|
|
|
(widget.chatMessageModel.isMyMessage ?? false)
|
|
|
|
|
? MyColors.darkIconColor
|
|
|
|
|
: MyColors.white,
|
|
|
|
|
isShadowEnabled: !(widget.chatMessageModel.isMyMessage ?? false),
|
|
|
|
|
backgroundColor: (widget.chatMessageModel.isMyMessage ?? false) ? MyColors.darkIconColor : MyColors.white,
|
|
|
|
|
borderRadius: 0,
|
|
|
|
|
margin: EdgeInsets.fromLTRB(
|
|
|
|
|
(widget.chatMessageModel.isMyMessage ?? false) ? 25 : 0,
|
|
|
|
|
0,
|
|
|
|
|
!(widget.chatMessageModel.isMyMessage ?? false) ? 25 : 0,
|
|
|
|
|
0),
|
|
|
|
|
margin: EdgeInsets.fromLTRB((widget.chatMessageModel.isMyMessage ?? false) ? 25 : 0, 0, !(widget.chatMessageModel.isMyMessage ?? false) ? 25 : 0, 0),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
|