Skip to content

Visual bug on the last two items of a ReorderableListView #88331

Description

@Innominus

Steps to Reproduce

File below includes the main dart file example:
main.zip

  1. Create any ReorderableListView with or without .builder(), and with any settings you want (this appears to be repeatable with any parameters or settings)
  2. add 2 or more items to the list
  3. go to the end of the list, hold and drag the second last item in the list
  4. pull the item over the last item in the list, and then bring the item you're holding back to its original position, second last
  5. Make sure you're not dragging and dropping the second last item into the last position, you're just hovering the second last item over the last item and then back again

Expected results:
I expected the item I'm dragging to go back into place where I originally held and dragged it from after I dropped it back in its original position

Actual results:
When you drop the item back where you originally dragged it from, the item decides to try and drop in the last position, and then snaps back to its original position

This is actually repeatable without running any code on your machine at all, you can do the same steps above with the example within the Flutter docs:
https://api.flutter.dev/flutter/material/ReorderableListView-class.html

Logs

flutter run --verbose

[  +40 ms] executing: uname -m
[  +19 ms] Exit code 0 from: uname -m
[        ] x86_64
[   +3 ms] executing: [/home/inno/snap/flutter/common/flutter/] git -c
log.showSignature=false log -n 1 --pretty=format:%H
[   +5 ms] Exit code 0 from: git -c log.showSignature=false log -n 1
--pretty=format:%H
[        ] 0f465e5b2a3ed2431321b490a614c3d15089854c
[        ] executing: [/home/inno/snap/flutter/common/flutter/] git tag
--points-at 0f465e5b2a3ed2431321b490a614c3d15089854c
[   +7 ms] Exit code 0 from: git tag --points-at
0f465e5b2a3ed2431321b490a614c3d15089854c
[        ] 2.5.0-5.0.pre
[   +6 ms] executing: [/home/inno/snap/flutter/common/flutter/] git rev-parse
--abbrev-ref --symbolic @{u}
[   +3 ms] Exit code 0 from: git rev-parse --abbrev-ref --symbolic @{u}
[        ] origin/dev
[        ] executing: [/home/inno/snap/flutter/common/flutter/] git ls-remote
--get-url origin
[   +2 ms] Exit code 0 from: git ls-remote --get-url origin
[        ] https://github.com/flutter/flutter.git
[  +50 ms] executing: [/home/inno/snap/flutter/common/flutter/] git rev-parse
--abbrev-ref HEAD
[   +4 ms] Exit code 0 from: git rev-parse --abbrev-ref HEAD
[        ] dev
[  +33 ms] Artifact Instance of 'AndroidGenSnapshotArtifacts' is not required,
skipping update.
[        ] Artifact Instance of 'AndroidInternalBuildArtifacts' is not required,
skipping update.
[        ] Artifact Instance of 'IOSEngineArtifacts' is not required, skipping
update.
[        ] Artifact Instance of 'FlutterWebSdk' is not required, skipping
update.
[   +1 ms] Artifact Instance of 'WindowsEngineArtifacts' is not required,
skipping update.
[        ] Artifact Instance of 'WindowsUwpEngineArtifacts' is not required,
skipping update.
[        ] Artifact Instance of 'MacOSEngineArtifacts' is not required, skipping
update.
[        ] Artifact Instance of 'LinuxEngineArtifacts' is not required, skipping
update.
[        ] Artifact Instance of 'LinuxFuchsiaSDKArtifacts' is not required,
skipping update.
[        ] Artifact Instance of 'MacOSFuchsiaSDKArtifacts' is not required,
skipping update.
[        ] Artifact Instance of 'FlutterRunnerSDKArtifacts' is not required,
skipping update.
[        ] Artifact Instance of 'FlutterRunnerDebugSymbols' is not required,
skipping update.
[  +38 ms] executing: /home/inno/Android/Sdk/platform-tools/adb devices -l
[  +22 ms] List of devices attached
[   +2 ms] Artifact Instance of 'AndroidGenSnapshotArtifacts' is not required,
skipping update.
[        ] Artifact Instance of 'AndroidInternalBuildArtifacts' is not required,
skipping update.
[        ] Artifact Instance of 'IOSEngineArtifacts' is not required, skipping
update.
[   +1 ms] Artifact Instance of 'WindowsEngineArtifacts' is not required,
skipping update.
[        ] Artifact Instance of 'WindowsUwpEngineArtifacts' is not required,
skipping update.
[        ] Artifact Instance of 'MacOSEngineArtifacts' is not required, skipping
update.
[        ] Artifact Instance of 'LinuxFuchsiaSDKArtifacts' is not required,
skipping update.
[        ] Artifact Instance of 'MacOSFuchsiaSDKArtifacts' is not required,
skipping update.
[        ] Artifact Instance of 'FlutterRunnerSDKArtifacts' is not required,
skipping update.
[        ] Artifact Instance of 'FlutterRunnerDebugSymbols' is not required,
skipping update.
[  +41 ms] Multiple devices found:
[  +75 ms] Linux (desktop) • linux  • linux-x64      • Ubuntu 20.04.2 LTS
5.11.0-25-generic
[   +1 ms] Chrome (web)    • chrome • web-javascript • Google Chrome
92.0.4515.131
[   +1 ms] [1]: Linux (linux)
[        ] [2]: Chrome (chrome)
[   +1 ms] Please choose one (To quit, press "q/Q")
[        ] : 

flutter analyze

Analyzing bug...                                                        
No issues found! (ran in 0.8s)

flutter doctor -v

[✓] Flutter (Channel dev, 2.5.0-5.0.pre, on Ubuntu 20.04.2 LTS
    5.11.0-25-generic, locale en_AU.UTF-8)
    • Flutter version 2.5.0-5.0.pre at /home/inno/snap/flutter/common/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 0f465e5b2a (12 days ago), 2021-08-04 18:59:50 -0400
    • Engine revision a0d89b1a54
    • Dart version 2.14.0 (build 2.14.0-377.0.dev)

[!] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
    • Android SDK at /home/inno/Android/Sdk
    ✗ cmdline-tools component is missing
      Run `path/to/sdkmanager --install "cmdline-tools;latest"`
      See https://developer.android.com/studio/command-line for more details.
    ✗ Android license status unknown.
      Run `flutter doctor --android-licenses` to accept the SDK licenses.
      See https://flutter.dev/docs/get-started/install/linux#android-setup for
      more details.

[✓] Chrome - develop for the web
    • Chrome at google-chrome

[✓] Linux toolchain - develop for Linux desktop
    • clang version 6.0.0-1ubuntu2 (tags/RELEASE_600/final)
    • cmake version 3.10.2
    • ninja version 1.8.2
    • pkg-config version 0.29.1

[!] Android Studio
    • Android Studio at /home/inno/Local_Code/android-studio
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    ✗ android-studio-dir = /home/inno/Local_Code/android-studio
    ✗ Android Studio not found at /home/inno/Local_Code/android-studio
    • Try updating or re-installing Android Studio.
    • Consider removing your android-studio-dir setting by running:
      flutter config --android-studio-dir=

[✓] VS Code
    • VS Code at /snap/code/current
    • Flutter extension version 3.25.0

[✓] Connected device (2 available)
    • Linux (desktop) • linux  • linux-x64      • Ubuntu 20.04.2 LTS
      5.11.0-25-generic
    • Chrome (web)    • chrome • web-javascript • Google Chrome 92.0.4515.131

Activity

  1. maheshj01 commented on Aug 17, 2021

    @maheshj01
    Member

    Hi @Innominus, Issue is reproducible on the latest stable and the master channel.

    Code sample
    import 'package:flutter/material.dart';
    
    void main() => runApp(const MyApp());
    
    /// This is the main application widget.
    class MyApp extends StatelessWidget {
      const MyApp({Key? key}) : super(key: key);
    
      static const String _title = 'Flutter Code Sample';
    
      @override
      Widget build(BuildContext context) {
        return MaterialApp(
          title: _title,
          home: Scaffold(
            appBar: AppBar(title: const Text(_title)),
            body: const MyStatefulWidget(),
          ),
        );
      }
    }
    
    /// This is the stateful widget that the main application instantiates.
    class MyStatefulWidget extends StatefulWidget {
      const MyStatefulWidget({Key? key}) : super(key: key);
    
      @override
      State<MyStatefulWidget> createState() => _MyStatefulWidgetState();
    }
    
    /// This is the private State class that goes with MyStatefulWidget.
    class _MyStatefulWidgetState extends State<MyStatefulWidget> {
      final List<int> _items = List<int>.generate(50, (int index) => index);
    
      @override
      Widget build(BuildContext context) {
        final ColorScheme colorScheme = Theme.of(context).colorScheme;
        final Color oddItemColor = colorScheme.primary.withOpacity(0.05);
        final Color evenItemColor = colorScheme.primary.withOpacity(0.15);
    
        return ReorderableListView(
          padding: const EdgeInsets.symmetric(horizontal: 40),
          children: <Widget>[
            for (int index = 0; index < _items.length; index++)
              ListTile(
                key: Key('$index'),
                tileColor: _items[index].isOdd ? oddItemColor : evenItemColor,
                title: Text('Item ${_items[index]}'),
              ),
          ],
          onReorder: (int oldIndex, int newIndex) {
            setState(() {
              if (oldIndex < newIndex) {
                newIndex -= 1;
              }
              final int item = _items.removeAt(oldIndex);
              _items.insert(newIndex, item);
            });
          },
        );
      }
    }
    
    Output
    Screen.Recording.2021-08-17.at.1.42.27.PM.mov
    flutter doctor -v
    [✓] Flutter (Channel stable, 2.2.3, on macOS 11.5.2 20G95 darwin-arm, locale en-GB)
        • Flutter version 2.2.3 at /Users/mahesh/Documents/flutter
        • Framework revision f4abaa0735 (6 weeks ago), 2021-07-01 12:46:11 -0700
        • Engine revision 241c87ad80
        • Dart version 2.13.4
    
    [✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
        • Android SDK at /Users/mahesh/Library/Android/sdk
        • Platform android-31, build-tools 31.0.0
        • ANDROID_HOME = /Users/mahesh/Library/Android/sdk
        • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
        • Java version OpenJDK Runtime Environment (build 11.0.8+10-b944.6916264)
        • All Android licenses accepted.
    
    [✓] Xcode - develop for iOS and macOS
        • Xcode at /Applications/Xcode.app/Contents/Developer
        • Xcode 12.5.1, Build version 12E507
        • CocoaPods version 1.10.1
    
    [✓] Chrome - develop for the web
        • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
    
    [✓] Android Studio (version 4.2)
        • Android Studio at /Applications/Android Studio.app/Contents
        • Flutter plugin can be installed from:
          🔨 https://plugins.jetbrains.com/plugin/9212-flutter
        • Dart plugin can be installed from:
          🔨 https://plugins.jetbrains.com/plugin/6351-dart
        • Java version OpenJDK Runtime Environment (build 11.0.8+10-b944.6916264)
    
    [✓] VS Code (version 1.58.0)
        • VS Code at /Applications/Visual Studio Code.app/Contents
        • Flutter extension version 3.25.0
    
    [✓] Connected device (4 available)
        • iPhone 12 Pro Max (mobile) • 5430F628-A903-402C-A635-D55D7E6EEFCA • ios            •
          com.apple.CoreSimulator.SimRuntime.iOS-14-5 (simulator)
        • macOS (desktop)            • macos                                • darwin-arm64   • macOS 11.5.2
          20G95 darwin-arm
        • Chrome (web)               • chrome                               • web-javascript • Google Chrome
          92.0.4515.131
    
    • No issues found!
    [✓] Flutter (Channel master, 2.5.0-7.0.pre.8, on macOS 11.5.2 20G95 darwin-arm, locale en-GB)
        • Flutter version 2.5.0-7.0.pre.8 at /Users/mahesh/Documents/flutter_master
        • Upstream repository https://github.com/flutter/flutter.git
        • Framework revision 40e8620a27 (7 days ago), 2021-08-06 09:14:50 +0430
        • Engine revision 431ac604da
        • Dart version 2.14.0 (build 2.14.0-383.0.dev)
    
    [✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
        • Android SDK at /Users/mahesh/Library/Android/sdk
        • Platform android-31, build-tools 31.0.0
        • ANDROID_HOME = /Users/mahesh/Library/Android/sdk
        • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
        • Java version OpenJDK Runtime Environment (build 11.0.8+10-b944.6916264)
        • All Android licenses accepted.
    
    [✓] Xcode - develop for iOS and macOS
        • Xcode at /Applications/Xcode.app/Contents/Developer
        • Xcode 12.5.1, Build version 12E507
        • CocoaPods version 1.10.1
    
    [✓] Chrome - develop for the web
        • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
    
    [✓] Android Studio (version 4.2)
        • Android Studio at /Applications/Android Studio.app/Contents
        • Flutter plugin can be installed from:
          🔨 https://plugins.jetbrains.com/plugin/9212-flutter
        • Dart plugin can be installed from:
          🔨 https://plugins.jetbrains.com/plugin/6351-dart
        • Java version OpenJDK Runtime Environment (build 11.0.8+10-b944.6916264)
    
    [✓] VS Code (version 1.58.0)
        • VS Code at /Applications/Visual Studio Code.app/Contents
        • Flutter extension version 3.25.0
    
    [✓] Connected device (4 available)
        • iPhone 12 Pro Max (mobile) • 5430F628-A903-402C-A635-D55D7E6EEFCA • ios            •
          com.apple.CoreSimulator.SimRuntime.iOS-14-5 (simulator)
        • macOS (desktop)            • macos                                • darwin-arm64   • macOS 11.5.2
          20G95 darwin-arm
        • Chrome (web)               • chrome                               • web-javascript • Google Chrome
          92.0.4515.131
    
    • No issues found!
  2. added
    frameworkflutter/packages/flutter repository. See also f: labels.
    has reproducible stepsThe issue has been confirmed reproducible and is ready to work on
    p: material_uimaterial_ui package in flutter/packages
    and removed
    in triagePresently being triaged by the triage team
    on Aug 17, 2021
  3. remarkked commented on Jul 29, 2024

    @remarkked

    For me this happens no matter if you're dragging the second last child or not, just for every child in ReorderableListView

  4. Maspital commented on Aug 23, 2024

    @Maspital

    I also want to chime in on this, while this bug is purely visual, it can lead to a lot of confusion for users. Has there been any progress?

  5. rubinbasha commented on Oct 9, 2024

    @rubinbasha

    I am also having the same unexpected issue, and for me just like @remarkked . The issue happens with every item, it is enough to drag to another position but then drag back to original position and drop there.
    the issue can be also send in the documentation page https://api.flutter.dev/flutter/material/ReorderableListView-class.html

  6. 30 remaining items

  7. added 7 commits that reference this issue on Jul 28, 2025
    c8c2c2a
    7d0ea7f
    7a353b0
    6bb0730
    34a22ad
    4a1b87d
    1bc028f
  8. added a commit that references this issue on Aug 7, 2025
    b6e78b9
  9. added a commit that references this issue on Aug 19, 2025
    ccc81da
  10. github-actions commented on Aug 21, 2025

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  11. locked as resolved and limited conversation to collaborators on Aug 21, 2025
  12. added a commit that references this issue on Sep 18, 2025
    083d6f4
  13. added a commit that references this issue on Sep 22, 2025
    1e08de5
  14. added a commit that references this issue on Nov 21, 2025
    568c3c6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work listfound in release: 2.2Found to occur in 2.2found in release: 2.5Found to occur in 2.5frameworkflutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onp: material_uimaterial_ui package in flutter/packagesteam-designOwned by Design Languages teamtriaged-designTriaged by Design Languages team

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions