Repository: flutter
Issue: Loop Failure: DragTarget inside Draggable
Labels: framework,f: material design,a: error message,has reproducible steps,found in release: 2.3,team-design,triaged-design

## Steps to Reproduce

1. Run `flutter create test_loop`.
2. Copypaste https://gist.github.com/1c51a3883c56eaff913068c5a2a62cda to main.dart
3. Run `flutter run`
4. Tap green DragTarget (Do not move finger/mouse)

**Expected results:** Old drag target is not here anymore, it cannot accept Draggables

**Actual results:** Old drag target is still here until any mouse movement, it can accept Draggables, when Draggable and Target are in one widget Flutter fails with  ```'parent == null || parent._lifecycleState == _ElementLifecycle.active': is not true```

<details>
  <summary>Logs</summary>

<!--
      Run your application with `flutter run --verbose` and attach all the
      log output below between the lines with the backticks. If there is an
      exception, please see if the error message includes enough information
      to explain how to solve the issue.
-->

```
======== Exception caught by widgets library =======================================================
The following assertion was thrown building Container:
'package:flutter/src/widgets/framework.dart': Failed assertion: line 3552 pos 14: 'node != newChild': is not true.


Either the assertion indicates an error in the framework itself, or we should provide substantially more information in this error message to help you determine and fix the underlying cause.
In either case, please report this assertion by filing a bug on GitHub:
  https://github.com/flutter/flutter/issues/new?template=2_bug.md

The relevant error-causing widget was: 
  Container file:///home/alex/Desktop/delta/delta/lib/runners/minimal_loop.dart:136:12
When the exception was thrown, this was the stack: 
#2      Element._debugCheckForCycles.<anonymous closure> (package:flutter/src/widgets/framework.dart:3552:14)
#3      Element._debugCheckForCycles (package:flutter/src/widgets/framework.dart:3554:6)
#4      Element.inflateWidget.<anonymous closure> (package:flutter/src/widgets/framework.dart:3527:11)
#5      Element.inflateWidget (package:flutter/src/widgets/framework.dart:3529:10)
#6      Element.updateChild (package:flutter/src/widgets/framework.dart:3306:18)
...
====================================================================================================

======== Exception caught by widgets library =======================================================
The following assertion was thrown building ChainHolder-[LabeledGlobalKey<HolderState<Holder>>#66ec0](state: ChainHolderState#4a990):
'package:flutter/src/widgets/framework.dart': Failed assertion: line 3341 pos 12: 'parent == null || parent._lifecycleState == _ElementLifecycle.active': is not true.


Either the assertion indicates an error in the framework itself, or we should provide substantially more information in this error message to help you determine and fix the underlying cause.
In either case, please report this assertion by filing a bug on GitHub:
  https://github.com/flutter/flutter/issues/new?template=2_bug.md

The relevant error-causing widget was: 
  ChainHolder-[LabeledGlobalKey<HolderState<Holder>>#66ec0] file:///home/alex/Desktop/delta/delta/lib/runners/minimal_loop.dart:95:14
When the exception was thrown, this was the stack: 
#2      Element.mount (package:flutter/src/widgets/framework.dart:3341:12)
#3      RenderObjectElement.mount (package:flutter/src/widgets/framework.dart:5342:11)
#4      Element.inflateWidget (package:flutter/src/widgets/framework.dart:3541:14)
#5      Element.updateChild (package:flutter/src/widgets/framework.dart:3306:18)
#6      ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4533:16)
...
====================================================================================================

======== Exception caught by widgets library =======================================================
The following assertion was thrown while rebuilding dirty elements:
'package:flutter/src/widgets/framework.dart': Failed assertion: line 3341 pos 12: 'parent == null || parent._lifecycleState == _ElementLifecycle.active': is not true.


Either the assertion indicates an error in the framework itself, or we should provide substantially more information in this error message to help you determine and fix the underlying cause.
In either case, please report this assertion by filing a bug on GitHub:
  https://github.com/flutter/flutter/issues/new?template=2_bug.md

The relevant error-causing widget was: 
  ChainHolder-[LabeledGlobalKey<HolderState<Holder>>#66ec0] file:///home/alex/Desktop/delta/delta/lib/runners/minimal_loop.dart:95:14
When the exception was thrown, this was the stack: 
#2      Element.mount (package:flutter/src/widgets/framework.dart:3341:12)
#3      RenderObjectElement.mount (package:flutter/src/widgets/framework.dart:5342:11)
#4      Element.inflateWidget (package:flutter/src/widgets/framework.dart:3541:14)
#5      Element.updateChild (package:flutter/src/widgets/framework.dart:3306:18)
#6      ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4533:16)
...
The element being rebuilt at the time was index 2 of 5: ChainHolder-[LabeledGlobalKey<HolderState<Holder>>#66ec0]
  state: ChainHolderState#4a990
====================================================================================================

======== Exception caught by widgets library =======================================================
The following assertion was thrown while finalizing the widget tree:
Duplicate GlobalKey detected in widget tree.

The following GlobalKey was specified multiple times in the widget tree. This will lead to parts of the widget tree being truncated unexpectedly, because the second time a key is seen, the previous instance is moved to the new location. The key was:
- [LabeledGlobalKey<BlockState<Block>>#3fbeb]
This was determined by noticing that after the widget with the above global key was moved out of its respective previous parents, those previous parents never updated during this frame, meaning that they either did not update at all or updated before the widget was moved, in either case implying that they still think that they should have a child with that global key.
The specific parents that did not update after having one or more children forcibly removed due to GlobalKey reparenting are:
- Column(direction: vertical, mainAxisAlignment: start, crossAxisAlignment: center, renderObject: RenderFlex#9c820 NEEDS-LAYOUT NEEDS-COMPOSITING-BITS-UPDATE DETACHED)
  _BodyBuilder
A GlobalKey can only be specified on one widget at a time in the widget tree.
When the exception was thrown, this was the stack: 
#0      BuildOwner.finalizeTree.<anonymous closure> (package:flutter/src/widgets/framework.dart:2845:15)
#1      BuildOwner.finalizeTree (package:flutter/src/widgets/framework.dart:2870:8)
#2      WidgetsBinding.drawFrame (package:flutter/src/widgets/binding.dart:875:19)
#3      RendererBinding._handlePersistentFrameCallback (package:flutter/src/rendering/binding.dart:319:5)
#4      SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:1144:15)
...
====================================================================================================

```

```
No issues found! (ran in 0.9s)
```

<!-- Finally, paste the output of running `flutter doctor -v` here. -->

```
[✓] Flutter (Channel beta, 2.0.2, on Linux, locale en_US.UTF-8)
    • Flutter version 2.0.2 at /home/alex/snap/flutter/common/flutter
    • Framework revision 8962f6dc68 (8 weeks ago), 2021-03-11 13:22:20 -0800
    • Engine revision 5d8bf811b3
    • Dart version 2.12.1

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
    • Android SDK at /home/alex/dev/android/sdk
    • Platform android-30, build-tools 30.0.3
    • Java binary at: /usr/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.11+9-Ubuntu-0ubuntu2.20.04)
    • All Android licenses accepted.

[✓] 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 (not installed)
    • Android Studio not found; download from https://developer.android.com/studio/index.html
      (or visit https://flutter.dev/docs/get-started/install/linux#android-setup for detailed instructions).

[✓] Connected device (2 available)
    • Linux (desktop) • linux  • linux-x64      • Linux
    • Chrome (web)    • chrome • web-javascript • Google Chrome 89.0.4389.114

! Doctor found issues in 1 category.

```

</details>