Skip to content

Commit

Permalink
reverted main
Browse files Browse the repository at this point in the history
  • Loading branch information
Desudar committed Sep 1, 2023
1 parent 23e66cf commit 9386631
Showing 1 changed file with 5 additions and 27 deletions.
32 changes: 5 additions & 27 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ class MyApp extends StatefulWidget {
}

class _MyAppState extends State<MyApp> {
static const _startCounter = 3;
final lockedIndices = <int>[0];
static const _startCounter = 3333;
final lockedIndices = <int>[];

int keyCounter = _startCounter;
List<int> children = List.generate(_startCounter, (index) => index);
ReorderableType reorderableType = ReorderableType.gridViewExtent;
ReorderableType reorderableType = ReorderableType.gridViewBuilder;

var _scrollController = ScrollController();
var _gridViewKey = GlobalKey();
Expand All @@ -45,14 +45,14 @@ class _MyAppState extends State<MyApp> {
onTapAddChild: () {
setState(() {
// children = children..add(keyCounter++);
children.insert(1, keyCounter++);
children.insert(0, keyCounter++);
});
},
onTapRemoveChild: () {
if (children.isNotEmpty) {
setState(() {
// children = children..removeLast();
children.removeAt(2);
children.removeAt(0);
});
}
},
Expand Down Expand Up @@ -222,28 +222,6 @@ class _MyAppState extends State<MyApp> {
}

Widget _getChild({required int index}) {
if (index == 0) {
return CustomDraggable(
key: Key(children[index].toString()),
data: index,
child: DragTarget(
onAccept: (v) {
setState(() {
children.removeAt(v as int);
});
},
builder: (context, candidateData, rejectedData) {
return Container(
height: 100.0,
width: 100.0,
child: Center(
child: Icon(Icons.delete),
),
);
},
));
}

return CustomDraggable(
key: Key(children[index].toString()),
data: index,
Expand Down

0 comments on commit 9386631

Please sign in to comment.