Flutter setState() or markNeedsBuild() called when widget tree was locked

前端 未结 7 1469
忘掉有多难
忘掉有多难 2020-12-03 06:45

I am having trouble finding the source to this exception, and the app is quite complex so it is hard to show any relevant part of the code. This is my repository at the poin

7条回答
  •  天涯浪人
    2020-12-03 07:38

    As the provided answer seems true, I had a work around as, in my case, it was not possible to simply remove it from the build.

    I used Future.delayed(Duration.zero, () => setState(() { ... })); instead of setState and the same for methods that may use setState as well.

    EDIT: source

提交回复
热议问题