Closed lukepighetti closed 2 years ago
There are a lot of abstract classes where a callback would do. I have had to build three wrapping classes to get callback functionality.
class DragCompletionCallback extends DragCompletion { DragCompletionCallback(this.callback); final void Function(List<DraggableGridItem> list) callback; @override void onDragAccept(List<DraggableGridItem> list) { callback(list); } } class DragChildWhenDraggingCallback extends DragChildWhenDragging { DragChildWhenDraggingCallback(this.callback); final Widget Function(List<DraggableGridItem> list, int index) callback; @override Widget dragChildWhenDragging(List<DraggableGridItem> list, int index) { return callback(list, index); } } class DragPlaceHolderCallback extends DragPlaceHolder { DragPlaceHolderCallback(this.callback); final PlaceHolderWidget Function(List<DraggableGridItem> list, int index) callback; @override PlaceHolderWidget placeHolder(List<DraggableGridItem> list, int index) { return callback(list, index); } }
There are a lot of abstract classes where a callback would do. I have had to build three wrapping classes to get callback functionality.