Skip to content

Add dragUpdate that receives the current drag position in ReorderableListView #139187

@DukePeoPlus

Description

@DukePeoPlus

Is there an existing issue for this?

Use case

i'm going to scroll the outer scroll with that drag update.

Proposal

As the title suggests, a drag update listener is needed in addition to drag end and drag start.

final void Function(Offset, Offset)? onReorderUpdate;

void _dragUpdate(_DragInfo item, Offset position, Offset delta) {
    setState(() {
      _overlayEntry?.markNeedsBuild();

      /* Added */
      widget.onReorderUpdate?.call(position, delta);

      _dragUpdateItems();
      _autoScroller?.startAutoScrollIfNecessary(_dragTargetRect);
    });
  }

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Issues that are less important to the Flutter projectc: new featureNothing broken; request for a new capabilityc: proposalA detailed proposal for a change to Flutterf: material designflutter/packages/flutter/material repository.frameworkflutter/packages/flutter repository. See also f: labels.team-designOwned by Design Languages teamtriaged-designTriaged by Design Languages team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions