Repository: flutter
Issue: Slider in Draggable.feedback does not work as expected and throws an error `LeaderLayer anchor must come before FollowerLayer in paint order, but the reverse was true.` 
Labels: framework,f: material design,a: error message,has reproducible steps,found in release: 2.8,found in release: 2.9,team-design,triaged-design

## Steps to Reproduce

<!-- Please include full steps to reproduce so that we can reproduce the problem. -->

1. Execute `flutter run` on the code sample <!-- (see "Code sample" section below) -->
2. Drag container around. 
3. This works as expected (Feedback is shown and dragging works).
4. Change state of slider by moving thumb.
5. Drag container around.

**Expected results:** The container remains draggable and feedback is properly shown and no error occurs.

**Actual results:** The feedback is not displayed any more. The child `jumps` to the target position. The following error is thrown:

![draggable_slider](https://user-images.githubusercontent.com/42271940/151171084-13a74cd1-4ea9-454c-b520-a501f96c1e6f.gif)


```dart
[+13303 ms] ══╡ EXCEPTION CAUGHT BY SCHEDULER LIBRARY ╞═════════════════════════════════════════════════════════
[   +3 ms] The following assertion was thrown during a scheduler callback:
[   +1 ms] Assertion failed:
[        ] file:///C:/Users/***/tools/flutter/packages/flutter/lib/src/rendering/layer.dart:2498:7
[        ] leader._lastOffset != null
[        ] "LeaderLayer anchor must come before FollowerLayer in paint order, but the reverse was true."
[        ] When the exception was thrown, this was the stack:
[        ] C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/errors.dart 251:49  throw_
[        ] C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/errors.dart 29:3    assertFailed
[        ] packages/flutter/src/rendering/layer.dart 2498:13                                                                          [_establishTransform]
[        ] packages/flutter/src/rendering/layer.dart 2557:5                                                                           addToScene
[        ] packages/flutter/src/rendering/layer.dart 546:5                                                                            [_addToSceneWithRetainedRendering]
[        ] packages/flutter/src/rendering/layer.dart 1106:12                                                                          addChildrenToScene
[        ] packages/flutter/src/rendering/layer.dart 1681:5                                                                           addToScene
[        ] packages/flutter/src/rendering/layer.dart 938:5                                                                            buildScene
[        ] packages/flutter/src/rendering/view.dart 226:30                                                                            compositeFrame
[        ] packages/flutter/src/rendering/binding.dart 501:18                                                                         drawFrame
[   +1 ms] packages/flutter/src/widgets/binding.dart 883:13                                                                           drawFrame
[        ] packages/flutter/src/rendering/binding.dart 363:5                                                                          [_handlePersistentFrameCallback]
[        ] packages/flutter/src/scheduler/binding.dart 1145:15                                                                        [_invokeFrameCallback]
[        ] packages/flutter/src/scheduler/binding.dart 1082:9                                                                         handleDrawFrame
[        ] packages/flutter/src/scheduler/binding.dart 996:5                                                                          [_handleDrawFrame]
[        ] C:/b/s/w/ir/cache/builder/src/out/host_debug/flutter_web_sdk/lib/_engine/engine/platform_dispatcher.dart 1005:13           invoke
[        ] C:/b/s/w/ir/cache/builder/src/out/host_debug/flutter_web_sdk/lib/_engine/engine/platform_dispatcher.dart 159:5             invokeOnDrawFrame
[        ] C:/b/s/w/ir/cache/builder/src/out/host_debug/flutter_web_sdk/lib/_engine/engine.dart 455:45                                <fn>
[        ] ════════════════════════════════════════════════════════════════════════════════════════════════════

```

<details>
<summary>
Code Sample
</summary>


```dart
import 'package:flutter/material.dart';

void main() => runApp(const SampleApp());

final GlobalKey myKey = GlobalKey();

class SampleApp extends StatefulWidget {
  const SampleApp({Key? key}) : super(key: key);

  @override
  _SampleAppState createState() => _SampleAppState();
}

class _SampleAppState extends State<SampleApp> {
  Offset position = Offset.zero;

  @override
  Widget build(BuildContext context) {
    final floatingPanel = Container(
      key: myKey,
      padding: const EdgeInsets.all(20),
      color: Colors.teal,
      child: const ContentWidget(),
    );
    return MaterialApp(
      title: 'Sample',
      home: Scaffold(
          body: Stack(
        children: [
          Positioned(
            left: position.dx,
            top: position.dy,
            child: Draggable<int>(
              data: 1,
              onDragEnd: (DraggableDetails details) {
                setState(() {
                  position = details.offset;
                });
              },
              feedback: floatingPanel,
              childWhenDragging: const SizedBox.shrink(),
              child: floatingPanel,
            ),
          )
        ],
      )),
    );
  }
}

class ContentWidget extends StatefulWidget {
  const ContentWidget({Key? key}) : super(key: key);

  @override
  _ContentWidgetState createState() => _ContentWidgetState();
}

class _ContentWidgetState extends State<ContentWidget> {
  double sliderValue = 0;
  @override
  Widget build(BuildContext context) => Material(
        child: Slider(
            value: sliderValue,
            onChanged: (v) {
              setState(() {
                sliderValue = v;
              });
            }),
      );
}

```

</details>

<details>
  <summary>Logs</summary>

<!--
     Run `flutter analyze` and attach any output of that command below.
     If there are any analysis errors, try resolving them before filing this issue.
-->

```
Analyzing sample_apps...                                                
No issues found! (ran in 7.5s)
```

<!-- Finally, paste the output of running `flutter doctor -v` here. -->

```
[√] Flutter (Channel stable, 2.8.1, on Microsoft Windows [Version 10.0.19042.867], locale de-DE)
    • Flutter version 2.8.1 at C:\Users\jonscn\tools\flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 77d935af4d (6 weeks ago), 2021-12-16 08:37:33 -0800
    • Engine revision 890a5fca2e
    • Dart version 2.15.1

[√] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
    • Android SDK at C:\Users\jonscn\AppData\Local\Android\sdk
    • Platform android-30, build-tools 30.0.3
    • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)
    • All Android licenses accepted.

[√] Chrome - develop for the web
    • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe

[√] Visual Studio - develop for Windows (Visual Studio Professional 2019 16.7.2)
    • Visual Studio at C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional
    • Visual Studio Professional 2019 version 16.7.30413.136
    • Windows 10 SDK version 10.0.17763.0

[√] Android Studio (version 4.1)
    • Android Studio at C:\Program Files\Android\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
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)

[√] VS Code (version 1.63.2)
    • VS Code at C:\Users\jonscn\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension version 3.32.0

[√] Connected device (3 available)
    • Windows (desktop) • windows • windows-x64    • Microsoft Windows [Version 10.0.19042.867]
    • Chrome (web)      • chrome  • web-javascript • Google Chrome 97.0.4692.71
    • Edge (web)        • edge    • web-javascript • Microsoft Edge 97.0.1072.62

• No issues found!
```

</details>


<!--
      Consider also attaching screenshots and/or videos to better
      illustrate the issue.

      You can upload them directly on GitHub.
      Beware that video file size is limited to 10MB.
-->