import 'package:flutter/material.dart';
class DraggableSliverList extends StatelessWidget { final List items;
const DraggableSliverList({Key? key, required this.items}) : super(key: key);
@override Widget build(BuildContext context) { return SliverList( delegate: SliverChildBuilderDelegate( (context, index) { return DragTarget( builder: (context, candidateData, rejectedData) { return Card( child: ListTile( title: Text('Item ${index + 1}'), ), ); }, onAccept: (data) { // Handle data received from another DragTarget // This might involve reordering the list }, onWillAccept: (data) { // Optionally, specify conditions for accepting data return true; // Accept data by default }, ); }, childCount: items.length, ), ); } }