rect_getter icon indicating copy to clipboard operation
rect_getter copied to clipboard

Error inserting new listview item

Open LucianoFM opened this issue 4 years ago • 0 comments

I got the error "package:flutter/src/rendering/object.dart': Failed assertion: line 2377 pos 12: 'attached': is not true"

Code: .... itemBuilder: (context, index){ Rect itemRect = RectGetter.getRectFromKey(myobject.key); myobject.isShowing = (itemRect != null && !(itemRect.top > this._screenRect.bottom || itemRect.bottom < this._screenRect.top)); ....

I got the error after inserting a new item in the listview: myNewObject.key = RectGetter.createGlobalKey(); this._myList.insert(0, myNewObject);

But if I update all listview items key: the error is avoided...

Is there a solution for this?

LucianoFM avatar Apr 16 '21 13:04 LucianoFM