The `onReorder` callback in the `ReorderableListView`, `ReorderableListView.builder`, `ReorderableList`, and `SliverReorderableList` widgets has been replaced by a new callback, `onReorderItem`, which provides more intuitive behavior for `newIndex`.
- Who is affected
- Code that still calls the deprecated API; it keeps working until removal but produces analyzer warnings. Code that uses ReorderableListView, ReorderableListView.builder, ReorderableList and related APIs.
- Practical impact
- Warnings now; removal in a future release. Plan the migration but no immediate break.
- What action should I take?
- Follow the official migration guide below, update affected call sites, run `dart fix --apply` where a fix is available, then run your tests.
Before and after (from the official guide)
| 1 | ReorderableListView( | |
| 2 | − | onReorder: (int oldIndex, int newIndex) { |
| 3 | − | if (oldIndex < newIndex) { |
| 4 | − | newIndex -= 1; |
| 5 | } | |
| 6 | − | |
| 7 | − | // Handle reorder ... |
| 8 | − | } |
| 9 | − | ) |
| 1 | ReorderableListView( | |
| 2 | + | - onReorder: (int oldIndex, int newIndex) { |
| 3 | + | - if (oldIndex < newIndex) { |
| 4 | + | - newIndex -= 1; |
| 5 | + | - } |
| 6 | + | - |
| 7 | + | + onReorderItem: (int oldIndex, int newIndex) { |
| 8 | + | // Handle reorder ... |
| 9 | } | |
| 10 | + | ) |
Raw before / after
ReorderableListView(
onReorder: (int oldIndex, int newIndex) {
if (oldIndex < newIndex) {
newIndex -= 1;
}
// Handle reorder ...
}
)ReorderableListView(
- onReorder: (int oldIndex, int newIndex) {
- if (oldIndex < newIndex) {
- newIndex -= 1;
- }
-
+ onReorderItem: (int oldIndex, int newIndex) {
// Handle reorder ...
}
)Official migration guide (excerpt, © The Flutter Authors, CC BY 3.0)
The ReorderableListView, ReorderableListView.builder,
ReorderableList, and SliverReorderableList widgets
share the same reordering logic.
The same migration steps apply to each of these widgets.
This migration guide uses ReorderableListView as an example.
Case 1: Simple callbacks {: #case-1-simple-callbacks }
Code before migration:
ReorderableListView(
onReorder: (int oldIndex, int newIndex) {
if (oldIndex < newIndex) {
newIndex -= 1;
}
// Handle reorder ...
}
)Code after migration:
ReorderableListView(
- onReorder: (int oldIndex, int newIndex) {
- if (oldIndex < newIndex) {
- newIndex -= 1;
- }
-
+ onReorderItem: (int oldIndex, int newIndex) {
// Handle reorder ...
}
)Case 2: Opt out for complex onReorder implementations {: #case-2-opt-out }
In some cases, such as when the provided callback is complex,
the migration to the new onReorderItem callback might not be obvious.
In these cases, to opt out of the new behavior,
adjust the newIndex to match the old behavior.
Code before migration:
void handleSomeComplexReorder(int oldIndex, int newIndex) {
// Handle reorder ...
}
ReorderableListView(
onReorder: (int oldIndex, int newIndex) {
handleSomeComplexReorder(oldIndex, newIndex);
}
)Code after migration:
void handleSomeComplexReorder(int oldIndex, int newIndex) {
// Handle reorder ...
}
ReorderableListView(
- onReorder: (int oldIndex, int newIndex) {
+ onReorderItem: (int oldIndex, int newIndex) {
+ // To get the equivalent of the old newIndex:
+ if (oldIndex < newIndex) {
+ newIndex += 1;
+ }
+
return handleSomeComplexReorder(oldIndex, newIndex);
}
)due to the change in meaning for the second callback parameter.
Landed in version: 3.41.0-1.0.pre-364 In stable release: 3.44
AI_PROVIDER (for example to openai-compatible with a local Ollama or LM Studio endpoint) to enable grounded explanations. Everything else on this page works without an AI provider.Listed in the official breaking-changes index; title states deprecation.
An official announcement or migration guide documents an intended behaviour or API change. A verified source change (git diff) shows code changed but does not by itself prove a public API is breaking. AI interpretations are labelled and never used to classify a change.
- Official migration guide
- ReorderCallback
- ReorderableList
- SliverReorderableList
- The index parameter for ReorderableListView's onReorderCallback is confusing
- SliverReorderableList newIndex arg off by one on drag down list
- Deprecate onReorder callback
- Source commit
- b3045439b7c0
- Source last updated
- Oct 21, 2026
- Last synchronized
- Oct 21, 2026
- Publication status
- published
Publication history
- Oct 21, 2026, 8:31 PM: new → published (ingestion) — Backed by an official breaking-change/migration guide.
AI_PROVIDER (for example to openai-compatible with a local Ollama or LM Studio endpoint) to enable grounded explanations. Everything else on this page works without an AI provider.