Skip to content

Commit

Permalink
[style] 채팅방 아이템 유저 아이템처럼 디자인 변경 #380
Browse files Browse the repository at this point in the history
  • Loading branch information
godeka committed May 29, 2024
1 parent 7764872 commit 3152860
Showing 1 changed file with 72 additions and 66 deletions.
138 changes: 72 additions & 66 deletions frontend/lib/widgets/chatting/chatroom_item.dart
Original file line number Diff line number Diff line change
Expand Up @@ -40,79 +40,85 @@ class ChatroomItem extends StatelessWidget {
},
);
},
child: Card(
child: Container(
padding: const EdgeInsets.symmetric(horizontal: 10),
child: Row(
children: [
Container(
padding: const EdgeInsets.all(10),
child: (logoUrl == '')
? const ProfileImgSmall(
isLocal: true,
logoUrl: "assets/coffee_bean.png",
)
: ProfileImgSmall(
isLocal: false,
logoUrl: logoUrl,
),
),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
nickname,
overflow: TextOverflow.ellipsis,
style: const TextStyle(
fontSize: 18,
fontWeight: FontWeight.bold,
),
child: Container(
height: 110,
margin: const EdgeInsets.only(bottom: 10),
padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 10),
decoration: BoxDecoration(
color: Colors.white,
border: Border.all(color: Colors.grey),
borderRadius: const BorderRadius.all(Radius.circular(10)),
),
child: Row(
children: [
Container(
padding: const EdgeInsets.all(10),
child: (logoUrl == '')
? const ProfileImgSmall(
isLocal: true,
logoUrl: "assets/coffee_bean.png",
)
: ProfileImgSmall(
isLocal: false,
logoUrl: logoUrl,
),
Row(
// spaceBetween: child widget을 시작과 끝에 배치하고
// 그 사이에 나머지 child widget을 배치
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Expanded(
child: Text(
recentMessage ?? '',
overflow: TextOverflow.ellipsis,
style: const TextStyle(
fontSize: 13,
),
),
Expanded(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
nickname,
overflow: TextOverflow.ellipsis,
style: const TextStyle(
fontSize: 18,
fontWeight: FontWeight.bold,
),
),
Row(
// spaceBetween: child widget을 시작과 끝에 배치하고
// 그 사이에 나머지 child widget을 배치
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Expanded(
child: Text(
recentMessage ?? '',
overflow: TextOverflow.ellipsis,
style: const TextStyle(
fontSize: 13,
),
),
// count 뱃지: 1 이상일 시에만 보이도록 설정
Visibility(
visible: count > 0,
child: Container(
margin: const EdgeInsets.all(12),
height: 30,
width: 30,
decoration: BoxDecoration(
color: Colors.red,
borderRadius: BorderRadius.circular(50),
),
child: Center(
child: Text(
(count < 100) ? count.toString() : '99+',
style: const TextStyle(
color: Colors.white,
fontSize: 12,
fontWeight: FontWeight.bold,
),
),
// count 뱃지: 1 이상일 시에만 보이도록 설정
Visibility(
visible: count > 0,
child: Container(
margin: const EdgeInsets.all(12),
height: 30,
width: 30,
decoration: BoxDecoration(
color: Colors.red,
borderRadius: BorderRadius.circular(50),
),
child: Center(
child: Text(
(count < 100) ? count.toString() : '99+',
style: const TextStyle(
color: Colors.white,
fontSize: 12,
fontWeight: FontWeight.bold,
),
),
),
)
],
),
],
),
),
)
],
),
],
),
],
),
),
],
),
),
);
Expand Down

0 comments on commit 3152860

Please sign in to comment.