Creating Nested Reorderable Lists with Custom Scrolling in Flutter

Learn how to create nested reorderable lists in Flutter and implement custom scrolling behavior for a seamless user experience.

Author

Sahil Sharma
Sahil SharmaSoftware Engineer- II

Date

Jul 12, 2024

Table of Contents

In this article, we will explore the process of creating nested reorderable lists in Flutter, with a focus on implementing custom scrolling behaviour. Reorderable lists are a powerful UI component that allow users to rearrange items within a list by dragging and dropping. While Flutter provides a built-in ReorderableListView widget that handles most of the functionality out of the box, certain use cases such as nested reorderable lists introduce challenges, particularly with scrolling behavior.

We will cover:

  • The basics of ReorderableListView
  • Creating a nested reorderable list
  • Implementing custom scrolling to handle edge cases
  • Full example with code and explanation

Understanding ReorderableListView

The ReorderableListView widget in Flutter makes it easy to implement drag-and-drop reordering within a list. Here’s a simple example to demonstrate the basic usage:

Challenges with Nested Reorderable Lists

The Problem

When implementing a nested ReorderableListView inside a SingleChildScrollView, the scrolling behaviour can be problematic. Specifically, the list does not scroll automatically when you drag an item near the edges of the screen, which can lead to a poor user experience.

When using nested ReorderableListView widgets, you might encounter issues, particularly with scrolling behavior. In a single ReorderableListView, scrolling is handled automatically as you drag an item near the top or bottom of the list. However, when nesting reorderable lists inside a scrollable parent, you might find that scrolling doesn’t behave as expected, especially when dragging items between different lists.

Implementing Nested Reorderable Lists

Let's build a more complex example with nested reorderable lists, and address the custom scrolling behavior to handle edge cases.

Step 1: Creating the Main Structure

First, we will set up the main structure with a scrollable parent that contains two reorderable lists.

Step 2: Handling Custom Scrolling

To handle custom scrolling when dragging items near the top or bottom, we need to implement logic that smooths out the scrolling behavior. The goal is to ensure the parent scroll view scrolls appropriately when dragging items in nested reorderable lists.

The Solution

To solve this issue, we need to:

  1. Use a ScrollController for the main scroll view.
  2. Handle continuous scrolling by monitoring the pointer's position relative to the screen.
  3. Use a Timer to ensure smooth and continuous scrolling when the user drags an item near the edges.

Complete Implementation

Below is the complete implementation of a nested reorderable list with custom scroll behavior in Flutter:

gif.gif

Explanation of Custom Scrolling Logic

  1. Listener Widget:
    • The Listener widget is used to capture pointer move events.
    • Calls _startAutoScroll with the dy position of the pointer to determine if scrolling should be started.
  2. _startAutoScroll Method:
    • Checks if the pointer is near the top or bottom of the screen.
    • Calls _startScrolling to initiate scrolling in the respective direction if the pointer is within the scroll threshold.
  3. _startScrolling and _stopScrolling Methods:
    • These methods handle the actual scrolling using a periodic timer to ensure smooth and continuous scrolling.
    • jumpTo is used to update the scroll position instantly, and the timer ensures regular updates for smooth scrolling.
  4. SingleChildScrollView with ScrollController:
    • Ensures the entire content is scrollable with a single ScrollController.
    • This controller is used to manage scrolling when dragging items near the edges.

By using these techniques, you can ensure a smooth and intuitive scrolling experience when dragging items in nested reorderable lists.

Conclusion

Creating nested reorderable lists in Flutter with custom scrolling behavior can be challenging but rewarding. By understanding the basics of ReorderableListView and implementing custom logic for handling edge cases, you can build a robust and user-friendly interface.

The full example provided in this article should give you a solid foundation to start with nested reorderable lists in your Flutter applications. Feel free to adjust the scrolling parameters and behavior to fit your specific needs. Happy coding!

SHARE ON

Related Articles.

More from the engineering frontline.

Dive deep into our research and insights on design, development, and the impact of various trends to businesses.

How We Built an AI System That Automates Senior Solution Architect Workflows
Article

Apr 6, 2026

How We Built an AI System That Automates Senior Solution Architect Workflows

Discover how we built a 4-agent AI co-pilot that converts complex RFPs into draft technical proposals in 15 minutes — with built-in conflict detection, assumption surfacing, and confidence scoring.

AI Code Healer for Fixing Broken CI/CD Builds Fast
Article

Apr 6, 2026

AI Code Healer for Fixing Broken CI/CD Builds Fast

A deep dive into how GeekyAnts built an AI-powered Code Healer that analyzes CI/CD failures, summarizes logs, and generates code-level fixes to keep development moving.

A Real-Time AI Fraud Decision Engine Under 50ms
Article

Apr 2, 2026

A Real-Time AI Fraud Decision Engine Under 50ms

A deep dive into how GeekyAnts built a real-time AI fraud detection system that evaluates transactions in milliseconds using a hybrid multi-agent approach.

Building an Autonomous Multi-Agent Fraud Detection System in Under 200ms
Article

Apr 1, 2026

Building an Autonomous Multi-Agent Fraud Detection System in Under 200ms

GeekyAnts built a 5-agent fraud detection pipeline that makes decisions in under 200ms — 15x cheaper than single-model systems, with full explainability built in.

Building a Self-Healing CI/CD System with an AI Agent
Article

Mar 31, 2026

Building a Self-Healing CI/CD System with an AI Agent

When code breaks a pipeline, developers have to stop working and figure out why. This blog shows how an AI agent reads the error, finds the fix, and submits it for review all on its own.

Maestro Automation Framework — Advanced to Expert
Article

Mar 26, 2026

Maestro Automation Framework — Advanced to Expert

Master Maestro at scale. Learn architecture, reusable flows, CI/CD optimization, and how to eliminate flakiness in production-grade mobile automation.Master Maestro at scale. Learn architecture, reusable flows, CI/CD optimization, and how to eliminate flakiness in production-grade mobile automation.

Scroll for more
View all articles