Skip to content

The index parameter for ReorderableListView's onReorderCallback is confusing. #127901

@HansMuller

Description

@HansMuller

The value of the onReorderCallback's newIndex and oldIndex parameters are non-intuitive due to some now-historical flawed API engineering. They're explained here: https://api.flutter.dev/flutter/widgets/ReorderCallback.html, but not in https://api.flutter.dev/flutter/material/ReorderableListView-class.html or in https://api.flutter.dev/flutter/material/ReorderableListView/onReorder.html.

We decided not to fix the problem because there wasn't a way to automatically update old apps: #93146 (comment) which many developers were unhappy about.

The documentation for the ReorderableListView and for ReorderableListView.onReorder should explain this quirk.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work listc: API breakBackwards-incompatible API changesd: api docsIssues with https://api.flutter.dev/f: 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