flutter_chatview icon indicating copy to clipboard operation
flutter_chatview copied to clipboard

ScrollController Exception

Open kkruel8100 opened this issue 1 year ago • 4 comments

The chatController is initialized as

chatController = ChatController( initialMessageList: messageList, scrollController: ScrollController(), currentUser: currentUser!, otherUsers: [otherUser!], ); 2. In the chatview, enter in incoming and receiving outgoing bubbles. Enough messages so that it has more messages than the height of the screen 3. Attempt to scroll up and down the view

Expected results: Scroll without exceptions

Actual results: Scroll with unlimited exceptions

Screenshot 2024-08-08 at 7 20 56 AM

I am on 2.0.0 and cannot update to newest version due to issues on that release.

Thank you for any assistance you can provide to resolve this issue.

kkruel8100 avatar Aug 08 '24 14:08 kkruel8100

@kkruel8100 I attempted to reproduce the issue but was unsuccessful. Could you please try it on the example and send me the steps to reproduce the issue along with the solution as soon as possible?

vatsaltanna avatar Aug 11 '24 05:08 vatsaltanna

I am having the same issue, but it's a bit difficult to extract the code in a reproduceable manner.

I have a tab navigation and this usually shows up when I go from one tab to another (and one of the tabs is a chat view)

mcosti avatar Aug 22 '24 20:08 mcosti

Could you please share the stack trace?

vatsaltanna avatar Aug 23 '24 10:08 vatsaltanna

E/flutter (30159): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: 'package:flutter/src/widgets/scroll_controller.dart': Failed assertion: line 158 pos 12: '_positions.length == 1': ScrollController attached to multiple scroll views. E/flutter (30159): #0 _AssertionError._doThrowNew (dart:core-patch/errors_patch.dart:51:61) E/flutter (30159): #1 _AssertionError._throwNew (dart:core-patch/errors_patch.dart:40:5) E/flutter (30159): #2 ScrollController.position (package:flutter/src/widgets/scroll_controller.dart:158:12) E/flutter (30159): #3 ChatController.scrollToLastMessage. (package:chatview/src/controller/chat_controller.dart:156:30) E/flutter (30159): #4 Timer._createTimer. (dart:async-patch/timer_patch.dart:18:15) E/flutter (30159): #5 _Timer._runTimers (dart:isolate-patch/timer_impl.dart:398:19) E/flutter (30159): #6 _Timer._handleMessage (dart:isolate-patch/timer_impl.dart:429:5) E/flutter (30159): #7 _RawReceivePort._handleMessage (dart:isolate-patch/isolate_patch.dart:184:12)

ahmedhosni-route avatar Aug 29 '24 00:08 ahmedhosni-route

still happening for me

Screenshot 2024-11-20 at 14 34 54 Screenshot 2024-11-20 at 14 35 25

lcsvcn avatar Nov 20 '24 17:11 lcsvcn