Repository: flutter
Issue: Rapid switching with AnimatedSwitcher leads to duplicate keys 
Labels: framework,a: animation,f: material design,a: error message,has reproducible steps,P2,found in release: 3.7,found in release: 3.8,team-design,triaged-design

## Issue

When using an `AnimatedSwitcher` to switch rapidly between widgets with different keys, it is possible to have two widgets with the same key end up in the `_outgoingWidgets` and thus in the internal `Stack`, leading it to throw an exception, as seen in the _Logs_ below (along with messing up the layout).

Consider the scenario of having widgets A and B, with `String` `ValueKey`'s of `"A"` and `"B"` respectively.
(If both widgets are of the same type, keys need to be set on them to force a transition to occur.)
The simplest form of this issue is then described by:

1. The `AnimatedSwitcher`'s `_currentEntry` is an instance of widget A (__A1__)
2. An instance of widget B gets switched in (__B1__)
a) __A1__ is added to the `_outgoingEntries` and its animation reversed, animating it out
b) __B1__ is made the `_currentEntry` and its animation driven forward, animating it in
3. An instance of widget A gets switched in (__A2__)
a) __B1__ is added to the `_outgoingEntries` and its animation reversed, animating it out
b) __A2__ is made the `_currentEntry` and its animation driven forward, animating it in
c) __A1__ is filtered out when passing the `_outgoingEntries` to the `layoutBuilder` (as per [#107476](https://github.com/flutter/flutter/pull/107476)), as it has the same key as the `_currentEntry` __A2__ (`"A"`)
d) Only __A2__ and __B1__ end up in the internal stack, so no exception is thrown
4. An instance of widget B gets switched in (__B2__)
a) __A2__ is added to the `_outgoingEntries` and its animation reversed, animating it out (notice that the `_outgoingEntries` now contain both __A1__ and __A2__)
b) ___B1__'s animation may possibly already be dismissed and thus removed from the `_outgoingEntries` (as its animation was reversed almost from the start in 3., as opposed to __A1__'a animation, which was reversed from the very end in 2., taking it longer to dismiss), which should not change the behavior of the bug though_
c) __B2__ is made the `_currentEntry` and its animation driven forward, animating it in
d) __B1__ (if still in the `_outgoingEntries`) is filtered out when passing them to the `layoutBuilder`, as it has the same key as the `_currentEntry` __B2__ (`"B"`)
e) Neither __A1__ nor __A2__ are filtered out when passing the `_outgoingEntries` to the `layoutBuilder`, as they have a different key then the `_currentEntry` (`"A"` vs. `"B"`)
f) Both __A1__, __A2__ and __B2__ end up in the internal stack, leading to the duplicate key `"A"` and thus the exception (see _Logs_)

As this bug requires rapid switching to occur, it is triggered easiest, when switching between only two different widgets.
However the bug should in theory not be limited by the number of different widgets (or rather different keys) being switched.

## Steps to Reproduce

1. Execute `flutter run` on the code sample
2.a) Either manually switch the `AnimatedSwitcher`'s child rapidly by pressing on the _"Switch manually"_ button (at least three times)
2.b) Or press on the _"Trigger bug"_ button to automatically let the child be switched fast enough to trigger the bug

**Expected results:**

__Either__ (using the naming from the example in _Issue_):
Seeing both __A1__ and __A2__ still animating out while __B2__ is animated in.

This would require the `AnimatedSwitcher` to use its _already available_ `_childNumber` (which currently only gets used when no key is set on the widgets) to create a new combined key, which is unambiguous for all the children of the `AnimatedSwitcher`.
This would solve the issue of duplicate keys on the internal stack.

Maybe this could look something like this:

```dart
class _ChildKey extends LocalKey {
  _ChildKey(this.childKey, this.childNumber);

  final Key? childKey;

  final int childNumber;

  @override
  bool operator ==(Object other) {
    return other is _ChildKey &&
        other.childKey == childKey &&
        other.childNumber == childNumber;
  }

  @override
  int get hashCode => Object.hash(runtimeType, childKey, childNumber);
}
```

__Note:__ This is the way the `AnimatedSwitcher` should actually behave according to its [documentation](https://api.flutter.dev/flutter/widgets/AnimatedSwitcher-class.html):

> The same key can be used for a new child as was used for an already-outgoing child; the two will not be considered related.

__OR__:
Seeing only __A2__ animate out while __B2__ is animated in

This would require the `AnimatedSwitcher`, upon recieving a widget with a key set, to remove all other widgets in its `_outgoingEntries`, that have the same key.
This would also solve the issue of duplicate keys on the internal stack, albeit not necessarily as nicely as the first option.

__Note:__ This is the way the `AnimatedSwitcher` currently behaves according to [this discussion](https://github.com/flutter/flutter/pull/106962#discussion_r915302231) on the pull request fixing a related problem.

**Actual results:**

The internal stack throws an exception upon recieving two children with the same key.
The exact exception can be seen in the _Logs_.

Additionally the layout of the stack gets messed up.

<details>
<summary>Code sample</summary>

```dart
import 'dart:async';

import 'package:flutter/material.dart';

void main() {
  runApp(const AnimatedSwitcherBug());
}

/// A very simple app demonstrating a bug in the AnimatedSwitcher.
class AnimatedSwitcherBug extends StatefulWidget {
  const AnimatedSwitcherBug({super.key});

  @override
  State<AnimatedSwitcherBug> createState() => AnimatedSwitcherBugState();
}

class AnimatedSwitcherBugState extends State<AnimatedSwitcherBug> {
  String text = 'A';

  late int count;

  Timer? timer;

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        body: Center(
          child: Column(
            mainAxisSize: MainAxisSize.min,
            children: [
              AnimatedSwitcher(
                duration: const Duration(milliseconds: 500),
                child: Text(
                  text,
                  key: ValueKey<String>(text),
                  style: Theme.of(context).textTheme.headlineLarge,
                ),
              ),
              TextButton(
                child: const Text(
                  'Switch manually',
                ),
                onPressed: () {
                  setState(() {
                    text = text == 'A' ? 'B' : 'A';
                  });
                },
              ),
              TextButton(
                child: const Text(
                  'Trigger bug',
                ),
                onPressed: () {
                  setState(() {
                    count = 3;

                    timer = Timer.periodic(
                      const Duration(milliseconds: 200),
                      (_) => setState(() {
                        text = text == 'A' ? 'B' : 'A';
                        count--;

                        if (count == 0) {
                          timer?.cancel();
                        }
                      }),
                    );
                  });
                },
              ),
            ],
          ),
        ),
      ),
    );
  }
}
```

</details>

<details>
  <summary>Logs</summary>

```
══╡ EXCEPTION CAUGHT BY WIDGETS LIBRARY ╞═══════════════════════════════════════════════════════════
The following assertion was thrown building AnimatedSwitcher(duration: 500ms, state:
_AnimatedSwitcherState#9ae97(tickers: tracking 3 tickers)):
Duplicate keys found.
If multiple keyed widgets exist as children of another widget, they must have unique keys.
Stack(alignment: Alignment.center, fit: loose) has multiple children with key [<[<[<'A'>]>]>].

The relevant error-causing widget was:
  AnimatedSwitcher
  AnimatedSwitcher:file:///home/jim/Developer/animated_switcher_bug/lib/main.dart:32:15

When the exception was thrown, this was the stack:
#0      debugChildrenHaveDuplicateKeys.<anonymous closure> (package:flutter/src/widgets/debug.dart:210:7)
#1      debugChildrenHaveDuplicateKeys (package:flutter/src/widgets/debug.dart:217:4)
#2      MultiChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:6536:13)
#3      Element.updateChild (package:flutter/src/widgets/framework.dart:3660:15)
#4      ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4993:16)
#5      StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:5133:11)
#6      Element.rebuild (package:flutter/src/widgets/framework.dart:4690:5)
#7      StatefulElement.update (package:flutter/src/widgets/framework.dart:5156:5)
#8      Element.updateChild (package:flutter/src/widgets/framework.dart:3660:15)
#9      RenderObjectElement.updateChildren (package:flutter/src/widgets/framework.dart:5981:32)
#10     MultiChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:6537:17)
#11     Element.updateChild (package:flutter/src/widgets/framework.dart:3660:15)
#12     SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:6384:14)
#13     Element.updateChild (package:flutter/src/widgets/framework.dart:3660:15)
#14     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4993:16)
#15     Element.rebuild (package:flutter/src/widgets/framework.dart:4690:5)
#16     StatelessElement.update (package:flutter/src/widgets/framework.dart:5044:5)
#17     Element.updateChild (package:flutter/src/widgets/framework.dart:3660:15)
#18     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4993:16)
#19     Element.rebuild (package:flutter/src/widgets/framework.dart:4690:5)
#20     StatelessElement.update (package:flutter/src/widgets/framework.dart:5044:5)
#21     Element.updateChild (package:flutter/src/widgets/framework.dart:3660:15)
#22     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4993:16)
#23     Element.rebuild (package:flutter/src/widgets/framework.dart:4690:5)
#24     ProxyElement.update (package:flutter/src/widgets/framework.dart:5301:5)
#25     Element.updateChild (package:flutter/src/widgets/framework.dart:3660:15)
#26     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4993:16)
#27     Element.rebuild (package:flutter/src/widgets/framework.dart:4690:5)
#28     ProxyElement.update (package:flutter/src/widgets/framework.dart:5301:5)
#29     Element.updateChild (package:flutter/src/widgets/framework.dart:3660:15)
#30     RenderObjectElement.updateChildren (package:flutter/src/widgets/framework.dart:5981:32)
#31     MultiChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:6537:17)
#32     Element.updateChild (package:flutter/src/widgets/framework.dart:3660:15)
#33     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4993:16)
#34     Element.rebuild (package:flutter/src/widgets/framework.dart:4690:5)
#35     ProxyElement.update (package:flutter/src/widgets/framework.dart:5301:5)
#36     Element.updateChild (package:flutter/src/widgets/framework.dart:3660:15)
#37     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4993:16)
#38     StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:5133:11)
#39     Element.rebuild (package:flutter/src/widgets/framework.dart:4690:5)
#40     StatefulElement.update (package:flutter/src/widgets/framework.dart:5156:5)
#41     Element.updateChild (package:flutter/src/widgets/framework.dart:3660:15)
#42     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4993:16)
#43     StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:5133:11)
#44     Element.rebuild (package:flutter/src/widgets/framework.dart:4690:5)
#45     StatefulElement.update (package:flutter/src/widgets/framework.dart:5156:5)
#46     Element.updateChild (package:flutter/src/widgets/framework.dart:3660:15)
#47     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4993:16)
#48     Element.rebuild (package:flutter/src/widgets/framework.dart:4690:5)
#49     ProxyElement.update (package:flutter/src/widgets/framework.dart:5301:5)
#50     Element.updateChild (package:flutter/src/widgets/framework.dart:3660:15)
#51     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4993:16)
#52     StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:5133:11)
#53     Element.rebuild (package:flutter/src/widgets/framework.dart:4690:5)
#54     StatefulElement.update (package:flutter/src/widgets/framework.dart:5156:5)
#55     Element.updateChild (package:flutter/src/widgets/framework.dart:3660:15)
#56     SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:6384:14)
#57     Element.updateChild (package:flutter/src/widgets/framework.dart:3660:15)
#58     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4993:16)
#59     Element.rebuild (package:flutter/src/widgets/framework.dart:4690:5)
#60     ProxyElement.update (package:flutter/src/widgets/framework.dart:5301:5)
#61     Element.updateChild (package:flutter/src/widgets/framework.dart:3660:15)
#62     SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:6384:14)
#63     Element.updateChild (package:flutter/src/widgets/framework.dart:3660:15)
#64     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4993:16)
#65     StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:5133:11)
#66     Element.rebuild (package:flutter/src/widgets/framework.dart:4690:5)
#67     StatefulElement.update (package:flutter/src/widgets/framework.dart:5156:5)
#68     Element.updateChild (package:flutter/src/widgets/framework.dart:3660:15)
#69     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4993:16)
#70     StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:5133:11)
#71     Element.rebuild (package:flutter/src/widgets/framework.dart:4690:5)
#72     StatefulElement.update (package:flutter/src/widgets/framework.dart:5156:5)
#73     Element.updateChild (package:flutter/src/widgets/framework.dart:3660:15)
#74     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4993:16)
#75     Element.rebuild (package:flutter/src/widgets/framework.dart:4690:5)
#76     ProxyElement.update (package:flutter/src/widgets/framework.dart:5301:5)
#77     Element.updateChild (package:flutter/src/widgets/framework.dart:3660:15)
#78     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4993:16)
#79     Element.rebuild (package:flutter/src/widgets/framework.dart:4690:5)
#80     ProxyElement.update (package:flutter/src/widgets/framework.dart:5301:5)
#81     Element.updateChild (package:flutter/src/widgets/framework.dart:3660:15)
#82     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4993:16)
#83     Element.rebuild (package:flutter/src/widgets/framework.dart:4690:5)
#84     ProxyElement.update (package:flutter/src/widgets/framework.dart:5301:5)
#85     Element.updateChild (package:flutter/src/widgets/framework.dart:3660:15)
#86     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4993:16)
#87     StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:5133:11)
#88     Element.rebuild (package:flutter/src/widgets/framework.dart:4690:5)
#89     StatefulElement.update (package:flutter/src/widgets/framework.dart:5156:5)
#90     Element.updateChild (package:flutter/src/widgets/framework.dart:3660:15)
#91     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4993:16)
#92     Element.rebuild (package:flutter/src/widgets/framework.dart:4690:5)
#93     ProxyElement.update (package:flutter/src/widgets/framework.dart:5301:5)
#94     Element.updateChild (package:flutter/src/widgets/framework.dart:3660:15)
#95     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4993:16)
#96     StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:5133:11)
#97     Element.rebuild (package:flutter/src/widgets/framework.dart:4690:5)
#98     StatefulElement.update (package:flutter/src/widgets/framework.dart:5156:5)
#99     Element.updateChild (package:flutter/src/widgets/framework.dart:3660:15)
#100    SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:6384:14)
#101    Element.updateChild (package:flutter/src/widgets/framework.dart:3660:15)
#102    ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4993:16)
#103    Element.rebuild (package:flutter/src/widgets/framework.dart:4690:5)
#104    StatelessElement.update (package:flutter/src/widgets/framework.dart:5044:5)
#105    Element.updateChild (package:flutter/src/widgets/framework.dart:3660:15)
#106    SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:6384:14)
#107    Element.updateChild (package:flutter/src/widgets/framework.dart:3660:15)
#108    SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:6384:14)
#109    Element.updateChild (package:flutter/src/widgets/framework.dart:3660:15)
#110    ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4993:16)
#111    StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:5133:11)
#112    Element.rebuild (package:flutter/src/widgets/framework.dart:4690:5)
#113    StatefulElement.update (package:flutter/src/widgets/framework.dart:5156:5)
#114    Element.updateChild (package:flutter/src/widgets/framework.dart:3660:15)
#115    SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:6384:14)
#116    Element.updateChild (package:flutter/src/widgets/framework.dart:3660:15)
#117    ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4993:16)
#118    StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:5133:11)
#119    Element.rebuild (package:flutter/src/widgets/framework.dart:4690:5)
#120    StatefulElement.update (package:flutter/src/widgets/framework.dart:5156:5)
#121    Element.updateChild (package:flutter/src/widgets/framework.dart:3660:15)
#122    SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:6384:14)
#123    Element.updateChild (package:flutter/src/widgets/framework.dart:3660:15)
#124    ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4993:16)
#125    StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:5133:11)
#126    Element.rebuild (package:flutter/src/widgets/framework.dart:4690:5)
#127    StatefulElement.update (package:flutter/src/widgets/framework.dart:5156:5)
#128    Element.updateChild (package:flutter/src/widgets/framework.dart:3660:15)
#129    ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4993:16)
#130    StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:5133:11)
#131    Element.rebuild (package:flutter/src/widgets/framework.dart:4690:5)
#132    StatefulElement.update (package:flutter/src/widgets/framework.dart:5156:5)
#133    Element.updateChild (package:flutter/src/widgets/framework.dart:3660:15)
#134    SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:6384:14)
#135    Element.updateChild (package:flutter/src/widgets/framework.dart:3660:15)
#136    ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4993:16)
#137    StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:5133:11)
#138    Element.rebuild (package:flutter/src/widgets/framework.dart:4690:5)
#139    StatefulElement.update (package:flutter/src/widgets/framework.dart:5156:5)
#140    Element.updateChild (package:flutter/src/widgets/framework.dart:3660:15)
#141    SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:6384:14)
#142    Element.updateChild (package:flutter/src/widgets/framework.dart:3660:15)
#143    ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4993:16)
#144    StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:5133:11)
#145    Element.rebuild (package:flutter/src/widgets/framework.dart:4690:5)
#146    StatefulElement.update (package:flutter/src/widgets/framework.dart:5156:5)
#147    Element.updateChild (package:flutter/src/widgets/framework.dart:3660:15)
#148    ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4993:16)
#149    StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:5133:11)
#150    Element.rebuild (package:flutter/src/widgets/framework.dart:4690:5)
#151    StatefulElement.update (package:flutter/src/widgets/framework.dart:5156:5)
#152    Element.updateChild (package:flutter/src/widgets/framework.dart:3660:15)
#153    ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4993:16)
#154    Element.rebuild (package:flutter/src/widgets/framework.dart:4690:5)
#155    StatelessElement.update (package:flutter/src/widgets/framework.dart:5044:5)
#156    Element.updateChild (package:flutter/src/widgets/framework.dart:3660:15)
#157    ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4993:16)
#158    StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:5133:11)
#159    Element.rebuild (package:flutter/src/widgets/framework.dart:4690:5)
#160    StatefulElement.update (package:flutter/src/widgets/framework.dart:5156:5)
#161    Element.updateChild (package:flutter/src/widgets/framework.dart:3660:15)
#162    SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:6384:14)
#163    Element.updateChild (package:flutter/src/widgets/framework.dart:3660:15)
#164    ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4993:16)
#165    Element.rebuild (package:flutter/src/widgets/framework.dart:4690:5)
#166    ProxyElement.update (package:flutter/src/widgets/framework.dart:5301:5)
#167    _InheritedNotifierElement.update (package:flutter/src/widgets/inherited_notifier.dart:107:11)
#168    Element.updateChild (package:flutter/src/widgets/framework.dart:3660:15)
#169    SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:6384:14)
#170    Element.updateChild (package:flutter/src/widgets/framework.dart:3660:15)
#171    ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4993:16)
#172    StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:5133:11)
#173    Element.rebuild (package:flutter/src/widgets/framework.dart:4690:5)
#174    StatefulElement.update (package:flutter/src/widgets/framework.dart:5156:5)
#175    Element.updateChild (package:flutter/src/widgets/framework.dart:3660:15)
#176    ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4993:16)
#177    Element.rebuild (package:flutter/src/widgets/framework.dart:4690:5)
#178    ProxyElement.update (package:flutter/src/widgets/framework.dart:5301:5)
#179    Element.updateChild (package:flutter/src/widgets/framework.dart:3660:15)
#180    ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4993:16)
#181    Element.rebuild (package:flutter/src/widgets/framework.dart:4690:5)
#182    ProxyElement.update (package:flutter/src/widgets/framework.dart:5301:5)
#183    Element.updateChild (package:flutter/src/widgets/framework.dart:3660:15)
#184    ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4993:16)
#185    StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:5133:11)
#186    Element.rebuild (package:flutter/src/widgets/framework.dart:4690:5)
#187    StatefulElement.update (package:flutter/src/widgets/framework.dart:5156:5)
#188    Element.updateChild (package:flutter/src/widgets/framework.dart:3660:15)
#189    ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4993:16)
#190    Element.rebuild (package:flutter/src/widgets/framework.dart:4690:5)
#191    StatelessElement.update (package:flutter/src/widgets/framework.dart:5044:5)
#192    Element.updateChild (package:flutter/src/widgets/framework.dart:3660:15)
#193    ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4993:16)
#194    Element.rebuild (package:flutter/src/widgets/framework.dart:4690:5)
#195    StatelessElement.update (package:flutter/src/widgets/framework.dart:5044:5)
#196    Element.updateChild (package:flutter/src/widgets/framework.dart:3660:15)
#197    SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:6384:14)
#198    Element.updateChild (package:flutter/src/widgets/framework.dart:3660:15)
#199    ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4993:16)
#200    Element.rebuild (package:flutter/src/widgets/framework.dart:4690:5)
#201    ProxyElement.update (package:flutter/src/widgets/framework.dart:5301:5)
#202    Element.updateChild (package:flutter/src/widgets/framework.dart:3660:15)
#203    ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4993:16)
#204    Element.rebuild (package:flutter/src/widgets/framework.dart:4690:5)
#205    ProxyElement.update (package:flutter/src/widgets/framework.dart:5301:5)
#206    Element.updateChild (package:flutter/src/widgets/framework.dart:3660:15)
#207    ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4993:16)
#208    StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:5133:11)
#209    Element.rebuild (package:flutter/src/widgets/framework.dart:4690:5)
#210    StatefulElement.update (package:flutter/src/widgets/framework.dart:5156:5)
#211    Element.updateChild (package:flutter/src/widgets/framework.dart:3660:15)
#212    ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4993:16)
#213    StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:5133:11)
#214    Element.rebuild (package:flutter/src/widgets/framework.dart:4690:5)
#215    StatefulElement.update (package:flutter/src/widgets/framework.dart:5156:5)
#216    Element.updateChild (package:flutter/src/widgets/framework.dart:3660:15)
#217    ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4993:16)
#218    StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:5133:11)
#219    Element.rebuild (package:flutter/src/widgets/framework.dart:4690:5)
#220    BuildOwner.buildScope (package:flutter/src/widgets/framework.dart:2743:19)
#221    WidgetsBinding.drawFrame (package:flutter/src/widgets/binding.dart:863:21)
#222    RendererBinding._handlePersistentFrameCallback (package:flutter/src/rendering/binding.dart:381:5)
#223    SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:1289:15)
#224    SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:1218:9)
#225    SchedulerBinding._handleDrawFrame (package:flutter/src/scheduler/binding.dart:1076:5)
#226    _invoke (dart:ui/hooks.dart:145:13)
#227    PlatformDispatcher._drawFrame (dart:ui/platform_dispatcher.dart:338:5)
#228    _drawFrame (dart:ui/hooks.dart:112:31)

════════════════════════════════════════════════════════════════════════════════════════════════════

Another exception was thrown: A RenderFlex overflowed by 99359 pixels on the bottom.
```

```
Analyzing animated_switcher_bug...                                      
No issues found! (ran in 0.5s)
```

```
[✓] Flutter (Channel stable, 3.7.5, on Ubuntu 22.04.1 LTS 5.19.0-32-generic, locale en_US.UTF-8)
    • Flutter version 3.7.5 on channel stable at /home/jim/opt/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision c07f788888 (13 hours ago), 2023-02-22 17:52:33 -0600
    • Engine revision 0f359063c4
    • Dart version 2.19.2
    • DevTools version 2.20.1

[!] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
    • Android SDK at /home/jim/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
    • Ubuntu clang version 14.0.0-1ubuntu1
    • cmake version 3.22.1
    • ninja version 1.10.1
    • pkg-config version 0.29.2

[✓] Android Studio (version 2020.3)
    • Android Studio at /home/jim/Developer/android-studio
    • Flutter plugin version 63.2.1
    • Dart plugin version 203.8452
    • Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)

[✓] Connected device (3 available)
    • IN2013 (mobile) • 1ed663a2 • android-arm64  • Android 12 (API 31)
    • Linux (desktop) • linux    • linux-x64      • Ubuntu 22.04.1 LTS 5.19.0-32-generic
    • Chrome (web)    • chrome   • web-javascript • Google Chrome 108.0.5359.98

[✓] HTTP Host Availability
    • All required HTTP hosts are available

! Doctor found issues in 1 category.
```

</details>