Skip to content

Conversation

@dhyash-simform
Copy link
Collaborator

Description

Checklist

  • The title of my PR starts with a [Conventional Commit] prefix (fix:, feat:, docs: etc).
  • I have followed the [Contributor Guide] when preparing my PR.
  • I have updated/added tests for ALL new/updated/fixed functionality.
  • I have updated/added relevant documentation in docs and added dartdoc comments with ///.
  • I have updated/added relevant examples in examples or docs.

Breaking Change?

  • Yes, this PR is a breaking change.
  • No, this PR is not a breaking change.

@dhyash-simform dhyash-simform force-pushed the feat/animate_on_update_chats branch 2 times, most recently from cfb7bff to e62a92b Compare August 14, 2025 06:18
sentBy: 'User',
id: 'msg-${DateTime.now().millisecondsSinceEpoch}',
),
settings: const ChatSettings(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be default.

Comment on lines 112 to 123
if (_searchResultMap != null) {
if (_searchResultMap?.containsKey(chatId) ?? false) {
_searchResultMap?.remove(chatId);
if (_chatListStreamController.isClosed) return;
animatedList.currentState?.removeItemByKey(chatId);
_chatListStreamController.add(_searchResultMap ?? chatListMap);
}
return;
}
if (_chatListStreamController.isClosed) return;
animatedList.currentState?.removeItemByKey(chatId);
_chatListStreamController.add(chatListMap);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please restructure this.

_chatListStreamController.add(chatListMap);
animatedList.currentState?.addChatItem(
chat,
isPinned: (item) => item.settings.pinStatus.isPinned,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be the default function.

Comment on lines 390 to 391
final message = messages[i];
_messageKeys.putIfAbsent(message.id, () => GlobalKey());
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This wouldn't run if separator is disabled by the user.

Comment on lines 190 to 192
: const SizedBox.shrink(
key: ValueKey('pinIcon-empty'),
),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can take this inside of IconScaleAnimation and provide key to icon inside as well.

Comment on lines 220 to 221
final removedKeys =
oldPositions.keys.where((key) => !newItemKeys.contains(key)).toList();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe you can accommodate this in the above loops.

..currentIndex = i;
} else {
// New item - only initialize if not already handled by addItem methods
if (!_itemStates.containsKey(key)) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please invert the condition for better readability.

Comment on lines 341 to 344
itemState.moveController.reset();
itemState.moveController.forward().then((_) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please utilise cascade notation.

Comment on lines 394 to 405
// Create animation controller for new item
final moveController = AnimationController(
duration: widget.animationDuration,
vsync: this,
);

_itemStates[key] = _ItemState<T>(
moveController: moveController,
item: newItem,
currentIndex: position,
);
_itemKeys[key] = GlobalKey();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This section seems to be repeated. Can you please extract it to a function?.


setState(() {
// Only animate if new item is added at top and should animate
if (_isNewItemAddedAtTop) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please invert the condition for better readability.

@dhyash-simform dhyash-simform force-pushed the feat/animate_on_update_chats branch from e62a92b to fd42228 Compare August 20, 2025 04:34
@dhyash-simform dhyash-simform changed the base branch from main to backup/feat/chat_view_list_ui August 20, 2025 04:34
@dhyash-simform dhyash-simform changed the base branch from backup/feat/chat_view_list_ui to feat/chat_list_ui_base August 20, 2025 04:35
@dhyash-simform dhyash-simform force-pushed the feat/animate_on_update_chats branch 5 times, most recently from ffe4325 to 679b038 Compare August 20, 2025 11:05
@dhyash-simform dhyash-simform force-pushed the feat/animate_on_update_chats branch from 679b038 to 02c61a7 Compare August 20, 2025 11:34
@aditya-css aditya-css merged commit fedae7b into feat/chat_list_ui_base Aug 20, 2025
1 check passed
@aditya-css aditya-css deleted the feat/animate_on_update_chats branch August 20, 2025 11:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants