@@ -103,7 +103,6 @@ class ReorderableListView extends StatefulWidget {
103
103
this .clipBehavior = Clip .hardEdge,
104
104
this .autoScrollerVelocityScalar,
105
105
this .dragBoundaryProvider,
106
- this .mouseCursor,
107
106
}) : assert (
108
107
(itemExtent == null && prototypeItem == null ) ||
109
108
(itemExtent == null && itemExtentBuilder == null ) ||
@@ -174,7 +173,6 @@ class ReorderableListView extends StatefulWidget {
174
173
this .clipBehavior = Clip .hardEdge,
175
174
this .autoScrollerVelocityScalar,
176
175
this .dragBoundaryProvider,
177
- this .mouseCursor,
178
176
}) : assert (itemCount >= 0 ),
179
177
assert (
180
178
(itemExtent == null && prototypeItem == null ) ||
@@ -300,18 +298,6 @@ class ReorderableListView extends StatefulWidget {
300
298
/// {@macro flutter.widgets.reorderable_list.dragBoundaryProvider}
301
299
final ReorderDragBoundaryProvider ? dragBoundaryProvider;
302
300
303
- /// The cursor for a mouse pointer when it enters or is hovering over the drag
304
- /// handle.
305
- ///
306
- /// If [mouseCursor] is a [WidgetStateMouseCursor] ,
307
- /// [WidgetStateProperty.resolve] is used for the following [WidgetState] s:
308
- ///
309
- /// * [WidgetState.dragged] .
310
- ///
311
- /// If this property is null, [SystemMouseCursors.grab] will be used when
312
- /// hovering, and [SystemMouseCursors.grabbing] when dragging.
313
- final MouseCursor ? mouseCursor;
314
-
315
301
@override
316
302
State <ReorderableListView > createState () => _ReorderableListViewState ();
317
303
}
@@ -335,21 +321,6 @@ class _ReorderableListViewState extends State<ReorderableListView> {
335
321
case TargetPlatform .linux:
336
322
case TargetPlatform .windows:
337
323
case TargetPlatform .macOS:
338
- final ListenableBuilder dragHandle = ListenableBuilder (
339
- listenable: _dragging,
340
- builder: (BuildContext context, Widget ? child) {
341
- final MouseCursor effectiveMouseCursor = WidgetStateProperty .resolveAs <MouseCursor >(
342
- widget.mouseCursor ??
343
- const WidgetStateMouseCursor .fromMap (< WidgetStatesConstraint , MouseCursor > {
344
- WidgetState .dragged: SystemMouseCursors .grabbing,
345
- WidgetState .any: SystemMouseCursors .grab,
346
- }),
347
- < WidgetState > {if (_dragging.value) WidgetState .dragged},
348
- );
349
- return MouseRegion (cursor: effectiveMouseCursor, child: child);
350
- },
351
- child: const Icon (Icons .drag_handle),
352
- );
353
324
switch (widget.scrollDirection) {
354
325
case Axis .horizontal:
355
326
return Stack (
@@ -363,7 +334,10 @@ class _ReorderableListViewState extends State<ReorderableListView> {
363
334
bottom: 8 ,
364
335
child: Align (
365
336
alignment: AlignmentDirectional .bottomCenter,
366
- child: ReorderableDragStartListener (index: index, child: dragHandle),
337
+ child: ReorderableDragStartListener (
338
+ index: index,
339
+ child: const Icon (Icons .drag_handle),
340
+ ),
367
341
),
368
342
),
369
343
],
@@ -380,7 +354,10 @@ class _ReorderableListViewState extends State<ReorderableListView> {
380
354
end: 8 ,
381
355
child: Align (
382
356
alignment: AlignmentDirectional .centerEnd,
383
- child: ReorderableDragStartListener (index: index, child: dragHandle),
357
+ child: ReorderableDragStartListener (
358
+ index: index,
359
+ child: const Icon (Icons .drag_handle),
360
+ ),
384
361
),
385
362
),
386
363
],
@@ -409,12 +386,6 @@ class _ReorderableListViewState extends State<ReorderableListView> {
409
386
);
410
387
}
411
388
412
- @override
413
- void dispose () {
414
- _dragging.dispose ();
415
- super .dispose ();
416
- }
417
-
418
389
@override
419
390
Widget build (BuildContext context) {
420
391
assert (debugCheckHasMaterialLocalizations (context));
@@ -472,14 +443,8 @@ class _ReorderableListViewState extends State<ReorderableListView> {
472
443
prototypeItem: widget.prototypeItem,
473
444
itemCount: widget.itemCount,
474
445
onReorder: widget.onReorder,
475
- onReorderStart: (int index) {
476
- _dragging.value = true ;
477
- widget.onReorderStart? .call (index);
478
- },
479
- onReorderEnd: (int index) {
480
- _dragging.value = false ;
481
- widget.onReorderEnd? .call (index);
482
- },
446
+ onReorderStart: widget.onReorderStart,
447
+ onReorderEnd: widget.onReorderEnd,
483
448
proxyDecorator: widget.proxyDecorator ?? _proxyDecorator,
484
449
autoScrollerVelocityScalar: widget.autoScrollerVelocityScalar,
485
450
dragBoundaryProvider: widget.dragBoundaryProvider,
0 commit comments