How do I put a ReorderableListView inside a Sliver?

499

I believe this is why the reorderables package exists - I don't think ReorderableListView supports slivers out of the box, so someone made a version which does. It doesn't behave in exactly the same way and there are some limitations (eg you can't seem to customise which area of the widget or which gesture is the trigger for dragging - you can only long-press on the whole widget) but it seems to work for me.

Share:
499
Grand
Author by

Grand

Irish software developer.

Updated on December 17, 2022

Comments

  • Grand
    Grand over 1 year

    I want a SliverAppBar at the top of the screen and a SliverFillRemaining below the ReorderableListView.

    I've tried multiple solutions and keep getting different errors with each one. CustomSCrollView with the ReorderableListView placed inside the slivers property gives the error "Failed assertion: line 4345 pos 14: 'owner._debugCurrentBuildTarget == this': is not true."

    I have also tried adding a SliverChildListDelegate and putting the ReorderableListView inside that, which gives another error.