Skip to content

[Feature request] Support for ReorderableListView #158

Closed

Description

@dreamAviator

Platforms

Android, iOS, macOS, Web, Windows, Linux

Description

It would be cool if this plugin also works for the ReorderableListView, I tried to use it with ReorderableListView.builder and it did not work.

Why

If one has a reorderable list, it would be cool to be able to jump to the element

Activity

  1. LinXunFeng commented on Sep 13, 2026

    @LinXunFeng
    Member

    Hi @dreamAviator, thanks for the report!

    ListViewObserver works with ReorderableListView. The only case that didn't work was when prototypeItem is set, which has been fixed in 1.27.2 via #159.

    If you are not using prototypeItem, please check the following:

    1. Pass the same ScrollController to both ListObserverController and ReorderableListView. Note that the parameter of ReorderableListView is named scrollController rather than controller, otherwise jumpTo / animateTo will do nothing.
    final scrollController = ScrollController();
    late final observerController = ListObserverController(controller: scrollController);
    
    ListViewObserver(
      controller: observerController,
      child: ReorderableListView.builder(
        scrollController: scrollController,
        itemCount: items.length,
        itemBuilder: (context, index) => ...,
        onReorder: ...,
      ),
    );
    1. If the list is not built in the first frame (e.g. it is shown after loading data), call observerController.reattach() after the list is displayed.

    2. Items may be moved after reordering, so jump to the current index of the target item, e.g. observerController.jumpTo(index: items.indexOf(targetItem)).

    There is also a new example: reorderable_listview_demo_page.dart.

    If it still doesn't work for you, could you share a minimal reproducible example?

  2. dreamAviator commented on Sep 13, 2026

    @dreamAviator
    Author
  3. dreamAviator commented on Sep 13, 2026

    @dreamAviator
    Author

    Okay, it works with the reorderableListview
    idk what I did wrong before, but thank you for your answer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions