Skip to content

Commit

Permalink
Fix size for chat list and logic
Browse files Browse the repository at this point in the history
  • Loading branch information
nqhhdev authored and hoangdat committed Oct 20, 2023
1 parent 53d4a70 commit 632d546
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 26 deletions.
1 change: 1 addition & 0 deletions lib/pages/chat_list/chat_list.dart
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,7 @@ class ChatListController extends State<ChatList>
Future<void> actionWithToggleSelectMode(Function action) async {
await action();
toggleSelectMode();
_clearSelectionItem();
}

void _clearSelectionItem() {
Expand Down
1 change: 1 addition & 0 deletions lib/pages/chat_list/chat_list_item.dart
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ class ChatListItem extends StatelessWidget with ChatListItemMixin {
onSecondaryTap: onSecondaryTap,
onLongPress: onLongPress,
child: Container(
height: ChatListItemStyle.chatItemHeight,
padding: ChatListItemStyle.paddingBody,
child: Row(
children: [
Expand Down
2 changes: 2 additions & 0 deletions lib/pages/chat_list/chat_list_item_style.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ class ChatListItemStyle {

static const double mentionIconWidth = 20;

static const double chatItemHeight = 85;

static double unreadBadgeSize(
bool unread,
bool hasNewMessages,
Expand Down
9 changes: 1 addition & 8 deletions lib/pages/chat_list/chat_list_item_subtitle.dart
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,7 @@ class ChatListItemSubtitle extends StatelessWidget with ChatListItemMixin {
children: <Widget>[
Expanded(
child: typingText.isNotEmpty
? Column(
children: [
Flexible(
child: typingTextWidget(typingText, context),
),
const Spacer(),
],
)
? typingTextWidget(typingText, context)
: (isGroup
? chatListItemSubtitleForGroup(
room: room,
Expand Down
28 changes: 10 additions & 18 deletions lib/presentation/mixins/chat_list_item_mixin.dart
Original file line number Diff line number Diff line change
Expand Up @@ -42,26 +42,18 @@ mixin ChatListItemMixin {
);
}

Row typingTextWidget(String typingText, BuildContext context) {
Widget typingTextWidget(String typingText, BuildContext context) {
final displayedTypingText = "~ $typingText…";
return Row(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.start,
children: [
Flexible(
child: Text(
displayedTypingText,
style: Theme.of(context).textTheme.labelLarge?.merge(
TextStyle(
overflow: TextOverflow.ellipsis,
color: Theme.of(context).colorScheme.primary,
),
),
maxLines: 2,
softWrap: true,
return Text(
displayedTypingText,
style: Theme.of(context).textTheme.labelLarge?.merge(
TextStyle(
overflow: TextOverflow.ellipsis,
color: Theme.of(context).colorScheme.primary,
),
),
),
],
maxLines: 2,
softWrap: true,
);
}

Expand Down

0 comments on commit 632d546

Please sign in to comment.