A flutter container widget that scrolls during drag and drop operatin. If you are creating your own drag-drop container, this could be useful.
All code for DragScrollContainer has been generated by GPT Engineer. This project was part of my experimentation and hands-on for using GPT Engineer. Using the prompt I was able to generate all the code for DragScrollContainer and partially code for ./example/lib/main.dart. I had to make very small changes to DragScrollContainer code to make it compile, then changed main.dart file fo example to my needs.
Supply the ScrollController and a child. Ie n the example below we are passing in the same ScrollController used by the ListView:
DragScrollContainer(
scrollController: scrollController1,
child: ListView.builder(
controller: scrollController1,
itemCount: 100,
itemBuilder:(context, index) => Center(child: DraggableBlock(index: index)),
),
)
launch.json as been configured to run the ./example/lib/main.dart.