Skip to content

Reorderable ListView visual order not updating after drag/drop #6859

@1Elko1

Description

@1Elko1

Can we access your project?

  • I give permission for members of the FlutterFlow team to access and test my project for the sole purpose of investigating this issue.

Current Behavior

Hi,
I'm dealing with a tricky Reorderable ListView issue that seems tied to nested data in App State.

Quick summary of the problem:

Reordering works perfectly (immediate visual update after drag/drop) when the Reorderable ListView is bound directly to a top-level/main App State variable (e.g., a simple List in App State).

But when I try the exact same setup for a nested list (a list field inside another struct/dataset, e.g., project.subTasks or group.items where the parent is in App State), the visual order doesn't update on screen after dropping the item — it looks like the componant doesnt update the refrence or somethigng.

The underlying data does update correctly (verified in debugger or by printing the nested list after reorder).

The correct reordered order only appears if I navigate away from the page and come back, or trigger a full page reload/rebuild.

Expected Behavior

After onReorder completes and the nested list in App State is updated, the ReorderableListView should rebuild automatically.

The visual order of items should update instantly without requiring:

Navigating away and back

A full page reload

Manually forcing rebuilds (dummy state toggles, rebuild actions, etc.)

Steps to Reproduce

  1. Create an App State variable containing a struct with a nested list

Example:

  • currentProject (ProjectStruct)
  • currentProject.subTasks (List)
  1. Add a ReorderableListView to a page and bind its data source to the nested list
    (FFAppState().currentProject.subTasks).

  2. Implement the onReorder callback to:

  • Remove the item at oldIndex
  • Insert it at newIndex (adjusting index if oldIndex < newIndex)
  • Update the nested list back into App State (currentProject.subTasks).
  1. Run the app and drag an item in the ReorderableListView to a new position.

  2. Observe that the nested list in App State updates correctly (confirmed via logs/debugger), but the visual order of the list does not update after dropping the item.

  3. Navigate away from the page and return, or trigger a full page rebuild.

  4. Observe that the reordered list now displays correctly.

  5. Repeat the same setup using a top-level App State list instead of a nested list and note that the UI updates immediately after reorder.

Reproducible from Blank

  • The steps to reproduce above start from a blank project.

Bug Report Code (Required)

Builder( builder: (context) { final subTasksList = FFAppState() .Tasks .elementAtOrNull(widget!.taskIndex!) ?.subTaskReal ?.toList() ?? []; return ReorderableListView.builder( padding: EdgeInsets.zero, proxyDecorator: (Widget child, int index, Animation animation) => Material(color: Colors.transparent, child: child), shrinkWrap: true, scrollDirection: Axis.vertical, itemCount: subTasksList.length, itemBuilder: (context, subTasksListIndex) { final subTasksListItem = subTasksList[subTasksListIndex]; return Container( key: ValueKey( "ListView_0r635opr" + '' + subTasksListIndex.toString()), child: Container( decoration: BoxDecoration(), child: SubTasksEntryBlackWidget( key: Key( 'Keyhl9${subTasksListIndex}of${subTasksList.length}'), text: subTasksListItem.text, complete: subTasksListItem.complete, taskInteger: widget!.taskIndex!, subTaskInteger: subTasksListIndex, entryDoc: widget!.entryDoc!, ), ), ); }, onReorder: (int reorderableOldIndex, int reorderableNewIndex) async { _model.newSubTasksList = await actions.reorderSubTasks( FFAppState() .Tasks .elementAtOrNull(widget!.taskIndex!)! .subTaskReal .toList(), reorderableOldIndex, reorderableNewIndex, ); FFAppState().updateTasksAtIndex( widget!.taskIndex!, (e) => e..subTaskReal = _model.newSubTasksList!.toList(), ); safeSetState(() {}); safeSetState(() {}); }, ); }, )

Visual documentation

Image Image Image Image Image

Environment

- FlutterFlow version: Latest
- Platform:Desktop or windows app
- Browser name and version: Chrome
- Operating system and version affected: Windows 10 Pro

Additional Information

No response

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions