fix(chat): image and clear search bar

This commit is contained in:
mso7nueh
2024-08-26 15:35:01 +03:00
parent a4c28e5ddf
commit 0a2eae6824
3 changed files with 29 additions and 15 deletions

View File

@@ -59,23 +59,29 @@ class _ChatScreenState extends State<ChatScreen> {
centerTitle: false,
title: Row(
children: [
Container(
width: 40,
height: 40,
alignment: Alignment.center,
decoration: BoxDecoration(
color: Color(0xFFEBF4FF),
shape: BoxShape.circle,
if (state.chatRoom.users['to_chat_user']!.profilePhotoUrl != null)
CircleAvatar(
radius: 20,
foregroundImage: NetworkImage(state.chatRoom.users['to_chat_user']!.profilePhotoUrl!),
),
child: Text(
state.chatRoom.users['to_chat_user']!.name.split(' ').first[0] + state.chatRoom.users['to_chat_user']!.name.split(' ')[1][0],
style: TextStyle(
color: Color(0xFF7F9CF5),
fontWeight: FontWeight.w400,
fontSize: 20,
if (state.chatRoom.users['to_chat_user']!.profilePhotoUrl == null)
Container(
width: 40,
height: 40,
alignment: Alignment.center,
decoration: BoxDecoration(
color: Color(0xFFEBF4FF),
shape: BoxShape.circle,
),
child: Text(
state.chatRoom.users['to_chat_user']!.name.split(' ').first[0] + state.chatRoom.users['to_chat_user']!.name.split(' ')[1][0],
style: TextStyle(
color: Color(0xFF7F9CF5),
fontWeight: FontWeight.w400,
fontSize: 20,
),
),
),
),
SizedBox(width: 16),
Column(
crossAxisAlignment: CrossAxisAlignment.start,

View File

@@ -39,6 +39,7 @@ class _ChatSelectScreenState extends State<ChatSelectScreen> {
title: Padding(
padding: const EdgeInsets.only(top: 8),
child: ChatSearchBarWidget(
onSuffixIconTap: () => context.read<ChatSelectCubit>().getChatRooms(),
onChanged: (query) {
if (query.length > 2) {
EasyDebounce.debounce(