Repository: flutter
Issue: [Hot Reload] Correcting the incorrect code and Hot Reloading the app throws Assertion Error
Labels: framework,t: hot reload,a: error message,has reproducible steps,P2,found in release: 2.8,found in release: 2.9,team-framework,triaged-framework

## Steps to Reproduce

Take this code and run it.
```
import 'package:flutter/material.dart';

void main() => runApp(const MaterialApp(home: MyHomePage(),),);

class MyHomePage extends StatefulWidget {
  const MyHomePage({Key? key}) : super(key: key);
  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: DropdownButtonFormField<String>(
        value: 'value',
        items: [DropdownMenuItem<String>(value: 'value', child: Text('value'),)],
        onChanged: (_) {},
      ),
    );
  }
}
```

Change `Text('value')` by `ListTile(title: Text('value'),)` and perform a Hot Reload.
You'll see a bunch of assertions.

Now change the code back to `Text('value')` and perform a Hot Reload.
You'll see the same assertions.

This a bit problematic for the developpement process, as I cannot be sure that it is my code that provokes these assertions, or a problem with the Hot Reload. Thus in this instance, I have to restart the app if I start seeing these assertions after rolling back a change.

flutter doctor -v
```
[√] Flutter (Channel stable, 2.8.1, on Microsoft Windows [version 10.0.19043.1415], locale fr-BE)
    • Flutter version 2.8.1 at D:\Flutter\flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 77d935af4d (8 days 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\Jerome\AppData\Local\Android\sdk
    • Platform android-31, build-tools 30.0.3
    • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)
    • All Android licenses accepted.

[√] Chrome - develop for the web
    • Chrome at C:\Program Files (x86)\Google\Chrome\Application\chrome.exe

[√] Visual Studio - develop for Windows (Visual Studio Community 2019 16.11.8)
    • Visual Studio at C:\Program Files (x86)\Microsoft Visual Studio\2019\Community
    • Visual Studio Community 2019 version 16.11.32002.261
    • Windows 10 SDK version 10.0.19041.0

[√] Android Studio (version 2020.3)
    • 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 11.0.10+0-b96-7249189)

[√] VS Code, 64-bit edition (version 1.58.0)
    • VS Code at C:\Program Files\Microsoft VS Code
    • Flutter extension version 3.25.0

[√] Connected device (4 available)
    • SM A750FN (mobile) • 32005e294fcf368d • android-arm64  • Android 10 (API 29)
    • Windows (desktop)  • windows          • windows-x64    • Microsoft Windows [version 10.0.19043.1415]
    • Chrome (web)       • chrome           • web-javascript • Google Chrome 96.0.4664.110
    • Edge (web)         • edge             • web-javascript • Microsoft Edge 96.0.1054.53

• No issues found!
```