From a0676992bc4083da9ed2d0920a321c0bed396ec2 Mon Sep 17 00:00:00 2001 From: flow Date: Thu, 27 Jul 2023 23:24:26 +0800 Subject: [PATCH] Support show user name in message --- lib/components/chat.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/components/chat.dart b/lib/components/chat.dart index 267ee76..066399f 100644 --- a/lib/components/chat.dart +++ b/lib/components/chat.dart @@ -195,7 +195,7 @@ class _ChatWindowState extends State { switch (message.source) { case MessageSource.user: icon = FontAwesomeIcons.fish; - name = "User"; + name = message.userName; color = const Color.fromARGB(255, 156, 225, 111); msg_box = Padding( padding: const EdgeInsets.all(8.0), @@ -210,7 +210,7 @@ class _ChatWindowState extends State { break; case MessageSource.bot: icon = FontAwesomeIcons.robot; - name = "Bot"; + name = "Bot#${message.userName}"; color = isDark ? const Color.fromARGB(255, 92, 89, 89) : const Color.fromARGB(255, 255, 255, 255);