refactor: polish chat detail screen

This commit is contained in:
Vick Top 2024-04-16 15:00:21 +02:00
parent 6e2d0feac9
commit 89edfdd18c
2 changed files with 24 additions and 35 deletions

View file

@ -102,11 +102,11 @@ class _ChatDetailRowState extends State<ChatDetailRow> {
) )
else else
Text( Text(
widget.message.sender.fullName?.toUpperCase() ?? widget.message.sender.fullName ??
widget.translations.anonymousUser, widget.translations.anonymousUser,
style: TextStyle( style: TextStyle(
fontSize: 14, fontSize: 16,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w800,
color: Theme.of(context) color: Theme.of(context)
.textTheme .textTheme
.labelMedium .labelMedium
@ -121,7 +121,8 @@ class _ChatDetailRowState extends State<ChatDetailRow> {
showFullDate: true, showFullDate: true,
), ),
style: const TextStyle( style: const TextStyle(
fontSize: 12, fontSize: 16,
fontWeight: FontWeight.w300,
color: Color(0xFFBBBBBB), color: Color(0xFFBBBBBB),
), ),
), ),

View file

@ -196,40 +196,28 @@ class _ChatDetailScreenState extends State<ChatDetailScreen> {
36.0, 36.0,
), ),
] else if (chatModel is PersonalChatModel) ...[ ] else if (chatModel is PersonalChatModel) ...[
widget.options.userAvatarBuilder( Row(
chatModel.user, mainAxisAlignment: MainAxisAlignment.center,
36.0, children: [
widget.options.userAvatarBuilder(
chatModel.user,
36.0,
),
const SizedBox(width: 8),
Text(
chatModel.user.firstName ??
widget.translations.anonymousUser,
style: theme.appBarTheme.titleTextStyle ??
const TextStyle(
fontSize: 18,
fontWeight: FontWeight.w800,
color: Colors.white,
),
),
],
), ),
] else ] else
...[], ...[],
Expanded(
child: Padding(
padding: const EdgeInsets.only(left: 15.5),
child: widget.chatTitleBuilder != null
? widget.chatTitleBuilder!.call(
(chatModel is GroupChatModel)
? chatModel.title
: (chatModel is PersonalChatModel)
? chatModel.user.fullName ??
widget
.translations.anonymousUser
: '',
)
: Text(
(chatModel is GroupChatModel)
? chatModel.title
: (chatModel is PersonalChatModel)
? chatModel.user.fullName ??
widget
.translations.anonymousUser
: '',
style: theme.appBarTheme.titleTextStyle ??
const TextStyle(
color: Colors.white,
),
),
),
),
], ],
), ),
), ),