-
-
Notifications
You must be signed in to change notification settings - Fork 46
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
[Discussions] Selection Text #86
Comments
This should be a bug of |
Sorry for my late reply. Can you give me some recommend to solve this problem? Thanks a lot. ExampleScreen.Recording.2024-07-22.at.08.17.00.mov |
I think you can pause the update of bool canUpdateListView = true;
Widget resultWidget = ChatItemWidget(
...
);
resultWidget = SelectionArea(
child: resultWidget,
onSelectionChanged: (value) {
canUpdateListView = value?.plainText == null;
// The text is no longer selected. Update the ListView to display all the latest messages.
if (canUpdateListView) {
setState(() {});
}
},
);
return resultWidget; _addMessage(int count) {
chatObserver.standby(changeCount: count);
needIncrementUnreadMsgCount = true;
for (var i = 0; i < count; i++) {
chatModels.insert(0, ChatDataHelper.createChatModel());
}
// Currently selecting text.
if (!canUpdateListView) return;
setState(() {});
} |
Let me try. |
Content
Content
Hi,
I use flutter_scrollview_observer for rendering list messages, and my case is after i select some texts and new message appear, the selection of text lost.
I have followed wiki.
I think the problem is my reversed list. Can you give me some recommend to solve this problem ? Thanks a lot.
My snippet code below:
The text was updated successfully, but these errors were encountered: