Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix size for chat list and logic #843

Merged
merged 1 commit into from
Oct 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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