Chat Fixes

merge-requests/41/head
Aamir Muhammad 3 years ago
parent 912ac80707
commit 40b9cb9576

@ -1,5 +1,4 @@
import 'dart:async';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
@ -21,7 +20,10 @@ class ChatDetailScreen extends StatelessWidget {
@override
Widget build(BuildContext context) {
userDetails = ModalRoute.of(context)!.settings.arguments;
userDetails = ModalRoute
.of(context)!
.settings
.arguments;
data = Provider.of<ChatProviderModel>(context, listen: false);
data.getSingleUserChatHistory(senderUID: AppState().chatDetails!.response!.id.toString(), receiverUID: userDetails["targetUser"].id, pagination: "0");
Timer(const Duration(seconds: 1), () => data.scrollDown());
@ -44,8 +46,8 @@ class ChatDetailScreen extends StatelessWidget {
return ChatBubble(
text: m.userChatHistory[i].contant.toString(),
isSeen: m.userChatHistory[i].isSeen == true ? true : false,
isCurrentUser: m.userChatHistory[i].currentUserId == 42062 ? true : false,
isDelivered: m.userChatHistory[i].currentUserId == 42062 && m.userChatHistory[i].isDelivered == true ? true : false,
isCurrentUser: m.userChatHistory[i].currentUserId == AppState().chatDetails!.response!.id ? true : false,
isDelivered: m.userChatHistory[i].currentUserId == AppState().chatDetails!.response!.id && m.userChatHistory[i].isDelivered == true ? true : false,
dateTime: m.userChatHistory[i].createdDate.toString(),
);
},
@ -66,17 +68,33 @@ class ChatDetailScreen extends StatelessWidget {
errorBorder: InputBorder.none,
disabledBorder: InputBorder.none,
contentPadding: const EdgeInsets.symmetric(vertical: 10, horizontal: 15),
suffixIcon: IconButton(
suffixIcon: SizedBox(
width: 100,
child: Row(
crossAxisAlignment: CrossAxisAlignment.end,
mainAxisAlignment: MainAxisAlignment.end,
children: [
IconButton(
icon: const Icon(
Icons.attach_file_rounded,
size: 27,
color: MyColors.lightGreenColor,
),
onPressed: () {},
),
IconButton(
icon: SvgPicture.asset(
"assets/icons/chat/chat_send_icon.svg",
height: 26,
width: 35,
),
onPressed: () {
// m.logger.d(userDetails);
m.sendChatMessage(m.message.text, userDetails["targetUser"].id, userDetails["targetUser"].userName);
},
),
],
),
),
),
),
),

Loading…
Cancel
Save