|
|
|
@ -91,23 +91,33 @@ class _TemporaryChatUIState extends State<TemporaryChatUI> {
|
|
|
|
width: 50,
|
|
|
|
width: 50,
|
|
|
|
alignment: Alignment.center,
|
|
|
|
alignment: Alignment.center,
|
|
|
|
decoration: const BoxDecoration(shape: BoxShape.circle, color: AppColor.neutral30),
|
|
|
|
decoration: const BoxDecoration(shape: BoxShape.circle, color: AppColor.neutral30),
|
|
|
|
child: const Icon(Icons.send_rounded).onPress(() {
|
|
|
|
child: IconButton(
|
|
|
|
if (textEditingController.text.isNotEmpty) {
|
|
|
|
splashColor: Colors.transparent,
|
|
|
|
final comment = GasRefillComment(
|
|
|
|
hoverColor: Colors.transparent,
|
|
|
|
id: 0,
|
|
|
|
highlightColor: Colors.transparent,
|
|
|
|
gasRefillId: 0,
|
|
|
|
onPressed: () {
|
|
|
|
comment: textEditingController.text,
|
|
|
|
if (textEditingController.text.isNotEmpty) {
|
|
|
|
createdOn: DateTime.now().toIso8601String(),
|
|
|
|
final comment = GasRefillComment(
|
|
|
|
createdBy: CreatedBy(userId: isSender ? "0" : "1", userName: isSender ? "Me" : "User"),
|
|
|
|
id: 0,
|
|
|
|
);
|
|
|
|
gasRefillId: 0,
|
|
|
|
isSender = !isSender;
|
|
|
|
comment: textEditingController.text,
|
|
|
|
chatList.add(comment);
|
|
|
|
createdOn: DateTime.now().toIso8601String(),
|
|
|
|
textEditingController.clear();
|
|
|
|
createdBy: CreatedBy(userId: isSender ? "0" : "1", userName: isSender ? "Me" : "User"),
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
isSender = !isSender;
|
|
|
|
|
|
|
|
chatList.add(comment);
|
|
|
|
|
|
|
|
textEditingController.clear();
|
|
|
|
|
|
|
|
|
|
|
|
chatList.sort((a, b) => DateTime.parse(b.createdOn!).compareTo(DateTime.parse(a.createdOn!)));
|
|
|
|
chatList.sort((a, b) => DateTime.parse(b.createdOn!).compareTo(DateTime.parse(a.createdOn!)));
|
|
|
|
setState(() {});
|
|
|
|
setState(() {});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})),
|
|
|
|
},
|
|
|
|
|
|
|
|
icon: const Icon(Icons.send_rounded))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// const Icon(Icons.send_rounded).onPress(() {
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
// })
|
|
|
|
|
|
|
|
),
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
|