解决 Flutter Exception: Attempting to start a drag on a non-visible item:
List<String> items = List.generate(20, (int i) => '$i'); ReorderableListView( children: <Widget>[ for (String item in items) Container( key: ValueKey(item), height: 100, margin: EdgeInsets.symmetric(horizontal: 50, vertical: 10), decoration: BoxDecoration( color: Colors.primaries[int.parse(item) % Colors.primaries.length], borderRadius: BorderRadius.circular(10)), ) ], onReorder: (int oldIndex, int newIndex) { if (oldIndex < newIndex) { newIndex -= 1; } var child = items.removeAt(oldIndex); items.insert(newIndex, child); setState(() {}); }, )