reorderables
reorderables copied to clipboard
ReorderableColumn : The getter 'width' was called on null.
I am using the "ReorderableColumn" but get stuck sometimes in a NoSuchMethodError Exception.
The following NoSuchMethodError was thrown building Builder(dirty):
The getter 'width' was called on null.
Receiver: null
Tried calling: width
It happend when the "buildDragTarget" get called in :
BoxConstraints contentSizeConstraints = BoxConstraints.loose(_draggingFeedbackSize);
At this point the _draggingFeedbackSize is null and will never be set to a valid size. The only code-snipper i found where this size is set is in :
void onDragStarted() {
setState(() {
_draggingWidget = toWrap;
_dragging = toWrap.key;
_dragStartIndex = index;
_ghostIndex = index;
_currentIndex = index;
_entranceController.value = 1.0;
_draggingFeedbackSize = keyIndexGlobalKey.currentContext.size;
});
}
An I am pretty sure that the onDragStarted method is not called before the buildDragTarget is called.
quick fix by myself : #80
quick fix by myself : #80
still doesn't work. Now items are poped to small grey points (
quick fix by myself : #80
still doesn't work. Now items are poped to small grey points (
Here is my widget implementation -> still working!
Material( color: Colors.transparent, child: Padding( padding: DefaultInsets.insetsBottom8, child: SingleChildScrollView( physics: physics, padding: childInsets, child: Container( width: double.infinity, child: ReorderableColumn( scrollController: controller, needsLongPressDraggable: false, onReorder: onReorder, children: children .map( (child) => ReorderableWidget( reorderable: sorting, key: Key(children.indexOf(child).toString()), child: child, ), ) .toList(growable: false), ), ), ), ), )
quick fix by myself : #80
still doesn't work. Now items are poped to small grey points (
Works for me too! You have to add ScrollController for ReorderableRow