fayeed / dash_chat

The most complete Chat UI for flutter highly customizable and helps developing chat UI faster.
https://pub.dev/packages/dash_chat
MIT License
445 stars 211 forks source link

Error when typing messages and pressing the back button #122

Open ngoc-quoc-huynh opened 4 years ago

ngoc-quoc-huynh commented 4 years ago

Describe the bug After typing some messages if I click on the chat or press the back button so that my keyboard disappears, I can't send messages anymore. This error only occurs if inverted is false.

The following assertion was thrown during performLayout():
Build scheduled during frame.

While the widget tree was being built, laid out, and painted, a new frame was scheduled to rebuild the widget tree.

This might be because setState() was called from a layout or paint callback. If a change is needed to the widget tree, it should be applied as the tree is being built. Scheduling a change for the subsequent frame instead results in an interface that lags behind by one frame. If this was done to make your build dependent on a size measured at layout time, consider using a LayoutBuilder, CustomSingleChildLayout, or CustomMultiChildLayout. If, on the other hand, the one frame delay is the desired effect, for example because this is an animation, consider scheduling the frame in a post-frame callback using SchedulerBinding.addPostFrameCallback or using an AnimationController to trigger the animation.!

To Reproduce Steps to reproduce the behavior:

  1. Go to DashChat
  2. Type some messages until you can scroll
  3. Type on the DashChat or press the back button

Expected behavior No error should occur and you can still send messages

Screenshots n/a

Desktop (please complete the following information):

Additional context n/a

SebastienBtr commented 4 years ago

I am not able to reproduce it