Repository: flutter
Issue: Cannot add new events while doing an addStream when using Broadcast Stream in tests
Labels: a: tests,c: crash,framework,has reproducible steps,P2,team-framework,triaged-framework,found in release: 3.24,found in release: 3.26

### Steps to reproduce

The following code throws an error, but if I remove `.broadcast`, so the streamcontroller becomes regular, then it works fine.
`print("done onPressed")` is never called.

### Expected results

Test passes

### Actual results

Test throws StateError exception

### Code sample

<details><summary>Code sample</summary>

```dart
import 'dart:async';

import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';

void main() {
  testWidgets("cooldown retry", (tester) async {
    await tester.pumpWidget(MyApp());
    await tester.tap(find.text("none"));
    await tester.pumpAndSettle();
    expect(find.textContaining("10"), findsOneWidget);
    await tester.pumpAndSettle(Duration(seconds: 11));
    expect(find.text("none"), findsOneWidget);
  });
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      debugShowCheckedModeBanner: false,
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: Scaffold(
        body: Center(
          child: _SendSMS(),
        ),
      ),
    );
  }
}

class _SendSMS extends StatefulWidget {
  // ignore: unused_element
  const _SendSMS({super.key});

  @override
  State<_SendSMS> createState() => _SendSMSState();
}

class _SendSMSState extends State<_SendSMS> {
  late final streamController = StreamController<int>.broadcast();

  @override
  void dispose() {
    print("closed");
    if (!streamController.isClosed) streamController.close();
    super.dispose();
  }

  @override
  Widget build(BuildContext context) {
    return StreamBuilder(
        stream: streamController.stream,
        initialData: 0,
        builder: (context, cooldown) {
          print("snapshot: ${cooldown.data}");

          return TextButton(
            onPressed: () async {
              streamController.add(10);
              print("start onPressed");
              await streamController.addStream(
                Stream.periodic(
                  Duration(seconds: 1),
                  (i) {
                    print("value: ${10 - i - 1}");
                    return 10 - i - 1;
                  },
                ).take(10),
              );
              print("done onPressed");
            },
            child: Text(
                (cooldown.data ?? 0) > 0 ? cooldown.data.toString() : "none"),
          );
        });
  }
}


```

</details>


### Screenshots or Video

_No response_

### Logs

<details><summary>Logs</summary>

```console
snapshot: 0
start onPreesed
snapshot: 10
value: 9
value: 8
value: 7
value: 6
value: 5
value: 4
value: 3
value: 2
value: 1
value: 0
snapshot: 0
closed
══╡ EXCEPTION CAUGHT BY WIDGETS LIBRARY ╞═══════════════════════════════════════════════════════════
The following StateError was thrown while finalizing the widget tree:
Bad state: Cannot add new events while doing an addStream

When the exception was thrown, this was the stack:
#1      _SendSMSState.dispose (file:///C:/Users/kkras/StudioProjects/testing/test/use_stream_test.dart:51:54)
#2      StatefulElement.unmount (package:flutter/src/widgets/framework.dart:5826:11)
#3      _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2077:13)
#4      _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:2075:7)
#5      SingleChildRenderObjectElement.visitChildren (package:flutter/src/widgets/framework.dart:6886:14)
#6      _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2073:13)
#7      _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:2075:7)
#8      ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5669:14)
#9      _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2073:13)
#10     _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:2075:7)
#11     ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5669:14)
#12     _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2073:13)
#13     _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:2075:7)
#14     ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5669:14)
#15     _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2073:13)
#16     _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:2075:7)
#17     ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5669:14)
#18     _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2073:13)
#19     _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:2075:7)
#20     MultiChildRenderObjectElement.visitChildren (package:flutter/src/widgets/framework.dart:6998:16)
#21     _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2073:13)
#22     _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:2075:7)
#23     ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5669:14)
#24     _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2073:13)
#25     _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:2075:7)
#26     ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5669:14)
#27     _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2073:13)
#28     _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:2075:7)
#29     ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5669:14)
#30     _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2073:13)
#31     _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:2075:7)
#32     ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5669:14)
#33     _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2073:13)
#34     _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:2075:7)
#35     ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5669:14)
#36     _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2073:13)
#37     _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:2075:7)
#38     SingleChildRenderObjectElement.visitChildren (package:flutter/src/widgets/framework.dart:6886:14)
#39     _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2073:13)
#40     _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:2075:7)
#41     ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5669:14)
#42     _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2073:13)
#43     _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:2075:7)
#44     SingleChildRenderObjectElement.visitChildren (package:flutter/src/widgets/framework.dart:6886:14)
#45     _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2073:13)
#46     _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:2075:7)
#47     ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5669:14)
#48     _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2073:13)
#49     _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:2075:7)
#50     ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5669:14)
#51     _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2073:13)
#52     _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:2075:7)
#53     ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5669:14)
#54     _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2073:13)
#55     _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:2075:7)
#56     ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5669:14)
#57     _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2073:13)
#58     _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:2075:7)
#59     ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5669:14)
#60     _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2073:13)
#61     _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:2075:7)
#62     ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5669:14)
#63     _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2073:13)
#64     _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:2075:7)
#65     ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5669:14)
#66     _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2073:13)
#67     _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:2075:7)
#68     ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5669:14)
#69     _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2073:13)
#70     _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:2075:7)
#71     SingleChildRenderObjectElement.visitChildren (package:flutter/src/widgets/framework.dart:6886:14)
#72     _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2073:13)
#73     _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:2075:7)
#74     ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5669:14)
#75     _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2073:13)
#76     _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:2075:7)
#77     SingleChildRenderObjectElement.visitChildren (package:flutter/src/widgets/framework.dart:6886:14)
#78     _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2073:13)
#79     _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:2075:7)
#80     SingleChildRenderObjectElement.visitChildren (package:flutter/src/widgets/framework.dart:6886:14)
#81     _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2073:13)
#82     _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:2075:7)
#83     ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5669:14)
#84     _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2073:13)
#85     _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:2075:7)
#86     SingleChildRenderObjectElement.visitChildren (package:flutter/src/widgets/framework.dart:6886:14)
#87     _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2073:13)
#88     _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:2075:7)
#89     ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5669:14)
#90     _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2073:13)
#91     _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:2075:7)
#92     SingleChildRenderObjectElement.visitChildren (package:flutter/src/widgets/framework.dart:6886:14)
#93     _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2073:13)
#94     _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:2075:7)
#95     ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5669:14)
#96     _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2073:13)
#97     _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:2075:7)
#98     ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5669:14)
#99     _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2073:13)
#100    _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:2075:7)
#101    SingleChildRenderObjectElement.visitChildren (package:flutter/src/widgets/framework.dart:6886:14)
#102    _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2073:13)
#103    _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:2075:7)
#104    ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5669:14)
#105    _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2073:13)
#106    _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:2075:7)
#107    SingleChildRenderObjectElement.visitChildren (package:flutter/src/widgets/framework.dart:6886:14)
#108    _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2073:13)
#109    _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:2075:7)
#110    ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5669:14)
#111    _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2073:13)
#112    _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:2075:7)
#113    ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5669:14)
#114    _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2073:13)
#115    _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:2075:7)
#116    ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5669:14)
#117    _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2073:13)
#118    _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:2075:7)
#119    ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5669:14)
#120    _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2073:13)
#121    _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:2075:7)
#122    ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5669:14)
#123    _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2073:13)
#124    _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:2075:7)
#125    SingleChildRenderObjectElement.visitChildren (package:flutter/src/widgets/framework.dart:6886:14)
#126    _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2073:13)
#127    _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:2075:7)
#128    ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5669:14)
#129    _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2073:13)
#130    _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:2075:7)
#131    SingleChildRenderObjectElement.visitChildren (package:flutter/src/widgets/framework.dart:6886:14)
#132    _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2073:13)
#133    _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:2075:7)
#134    ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5669:14)
#135    _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2073:13)
#136    _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:2075:7)
#137    ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5669:14)
#138    _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2073:13)
#139    _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:2075:7)
#140    ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5669:14)
#141    _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2073:13)
#142    _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:2075:7)
#143    ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5669:14)
#144    _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2073:13)
#145    _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:2075:7)
#146    ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5669:14)
#147    _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2073:13)
#148    _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:2075:7)
#149    ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5669:14)
#150    _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2073:13)
#151    _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:2075:7)
#152    SingleChildRenderObjectElement.visitChildren (package:flutter/src/widgets/framework.dart:6886:14)
#153    _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2073:13)
#154    _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:2075:7)
#155    ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5669:14)
#156    _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2073:13)
#157    _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:2075:7)
#158    ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5669:14)
#159    _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2073:13)
#160    _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:2075:7)
#161    ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5669:14)
#162    _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2073:13)
#163    _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:2075:7)
#164    ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5669:14)
#165    _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2073:13)
#166    _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:2075:7)
#167    ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5669:14)
#168    _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2073:13)
#169    _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:2075:7)
#170    SingleChildRenderObjectElement.visitChildren (package:flutter/src/widgets/framework.dart:6886:14)
#171    _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2073:13)
#172    _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:2075:7)
#173    ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5669:14)
#174    _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2073:13)
#175    _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:2075:7)
#176    ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5669:14)
#177    _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2073:13)
#178    _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:2075:7)
#179    ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5669:14)
#180    _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2073:13)
#181    _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:2075:7)
#182    ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5669:14)
#183    _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2073:13)
#184    _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:2075:7)
#185    MultiChildRenderObjectElement.visitChildren (package:flutter/src/widgets/framework.dart:6998:16)
#186    _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2073:13)
#187    _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:2075:7)
#188    ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5669:14)
#189    _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2073:13)
#190    _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:2075:7)
#191    ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5669:14)
#192    _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2073:13)
#193    _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:2075:7)
#194    ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5669:14)
#195    _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2073:13)
#196    _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:2075:7)
#197    ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5669:14)
#198    _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2073:13)
#199    _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:2075:7)
#200    ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5669:14)
#201    _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2073:13)
#202    _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:2075:7)
#203    ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5669:14)
#204    _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2073:13)
#205    _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:2075:7)
#206    ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5669:14)
#207    _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2073:13)
#208    _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:2075:7)
#209    SingleChildRenderObjectElement.visitChildren (package:flutter/src/widgets/framework.dart:6886:14)
#210    _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2073:13)
#211    _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:2075:7)
#212    SingleChildRenderObjectElement.visitChildren (package:flutter/src/widgets/framework.dart:6886:14)
#213    _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2073:13)
#214    _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:2075:7)
#215    ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5669:14)
#216    _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2073:13)
#217    _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:2075:7)
#218    ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5669:14)
#219    _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2073:13)
#220    _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:2075:7)
#221    ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5669:14)
#222    _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2073:13)
#223    _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:2075:7)
#224    ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5669:14)
#225    _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2073:13)
#226    _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:2075:7)
#227    SingleChildRenderObjectElement.visitChildren (package:flutter/src/widgets/framework.dart:6886:14)
#228    _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2073:13)
#229    _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:2075:7)
#230    ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5669:14)
#231    _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2073:13)
#232    _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:2075:7)
#233    ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5669:14)
#234    _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2073:13)
#235    _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:2075:7)
#236    ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5669:14)
#237    _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2073:13)
#238    _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:2075:7)
#239    ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5669:14)
#240    _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2073:13)
#241    _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:2075:7)
#242    ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5669:14)
#243    _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2073:13)
#244    _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:2075:7)
#245    ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5669:14)
#246    _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2073:13)
#247    _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:2075:7)
#248    ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5669:14)
#249    _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2073:13)
#250    _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:2075:7)
#251    ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5669:14)
#252    _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2073:13)
#253    _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:2075:7)
#254    ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5669:14)
#255    _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2073:13)
#256    _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:2075:7)
#257    ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5669:14)
#258    _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2073:13)
#259    _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:2075:7)
#260    ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5669:14)
#261    _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2073:13)
#262    _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:2075:7)
#263    ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5669:14)
#264    _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2073:13)
#265    _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:2075:7)
#266    ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5669:14)
#267    _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2073:13)
#268    _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:2075:7)
#269    ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5669:14)
#270    _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2073:13)
#271    _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:2075:7)
#272    ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5669:14)
#273    _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2073:13)
#274    _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:2075:7)
#275    ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5669:14)
#276    _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2073:13)
#277    _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:2075:7)
#278    ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5669:14)
#279    _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2073:13)
#280    _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:2075:7)
#281    ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5669:14)
#282    _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2073:13)
#283    _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:2075:7)
#284    SingleChildRenderObjectElement.visitChildren (package:flutter/src/widgets/framework.dart:6886:14)
#285    _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2073:13)
#286    _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:2075:7)
#287    ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5669:14)
#288    _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2073:13)
#289    _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:2075:7)
#290    SingleChildRenderObjectElement.visitChildren (package:flutter/src/widgets/framework.dart:6886:14)
#291    _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2073:13)
#292    _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:2075:7)
#293    ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5669:14)
#294    _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2073:13)
#295    _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:2075:7)
#296    ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5669:14)
#297    _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2073:13)
#298    _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:2075:7)
#299    ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5669:14)
#300    _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2073:13)
#301    _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:2075:7)
#302    ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5669:14)
#303    _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2073:13)
#304    _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:2075:7)
#305    ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5669:14)
#306    _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2073:13)
#307    _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:2075:7)
#308    SingleChildRenderObjectElement.visitChildren (package:flutter/src/widgets/framework.dart:6886:14)
#309    _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2073:13)
#310    _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:2075:7)
#311    ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5669:14)
#312    _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2073:13)
#313    _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:2075:7)
#314    ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5669:14)
#315    _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2073:13)
#316    _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:2075:7)
#317    ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5669:14)
#318    _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2073:13)
#319    _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:2075:7)
#320    ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5669:14)
#321    _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2073:13)
#322    _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:2075:7)
#323    ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5669:14)
#324    _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2073:13)
#325    _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:2075:7)
#326    SingleChildRenderObjectElement.visitChildren (package:flutter/src/widgets/framework.dart:6886:14)
#327    _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2073:13)
#328    _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:2075:7)
#329    ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5669:14)
#330    _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2073:13)
#331    _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:2075:7)
#332    ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5669:14)
#333    _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2073:13)
#334    _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:2075:7)
#335    ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5669:14)
#336    _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2073:13)
#337    _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:2075:7)
#338    ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5669:14)
#339    _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2073:13)
#340    _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:2075:7)
#341    SingleChildRenderObjectElement.visitChildren (package:flutter/src/widgets/framework.dart:6886:14)
#342    _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2073:13)
#343    _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:2075:7)
#344    ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5669:14)
#345    _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2073:13)
#346    _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:2075:7)
#347    ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5669:14)
#348    _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2073:13)
#349    _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:2075:7)
#350    ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5669:14)
#351    _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2073:13)
#352    _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:2075:7)
#353    ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5669:14)
#354    _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2073:13)
#355    _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:2075:7)
#356    ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5669:14)
#357    _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2073:13)
#358    _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:2075:7)
#359    ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5669:14)
#360    _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2073:13)
#361    _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:2075:7)
#362    ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5669:14)
#363    _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2073:13)
#364    _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:2075:7)
#365    ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5669:14)
#366    _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2073:13)
#367    _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:2075:7)
#368    ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5669:14)
#369    _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2073:13)
#370    _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:2075:7)
#371    ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5669:14)
#372    _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2073:13)
#373    _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:2075:7)
#374    ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5669:14)
#375    _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2073:13)
#376    _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:2075:7)
#377    SingleChildRenderObjectElement.visitChildren (package:flutter/src/widgets/framework.dart:6886:14)
#378    _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2073:13)
#379    _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:2075:7)
#380    ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5669:14)
#381    _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2073:13)
#382    _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:2075:7)
#383    ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5669:14)
#384    _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2073:13)
#385    _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:2075:7)
#386    ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5669:14)
#387    _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2073:13)
#388    _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:2075:7)
#389    ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5669:14)
#390    _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2073:13)
#391    _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:2075:7)
#392    ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5669:14)
#393    _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2073:13)
#394    _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:2075:7)
#395    ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5669:14)
#396    _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2073:13)
#397    ListIterable.forEach (dart:_internal/iterable.dart:49:13)
#398    _InactiveElements._unmountAll (package:flutter/src/widgets/framework.dart:2086:25)
#399    BuildOwner.lockState (package:flutter/src/widgets/framework.dart:2954:15)
#400    BuildOwner.finalizeTree (package:flutter/src/widgets/framework.dart:3264:7)
#401    AutomatedTestWidgetsFlutterBinding.drawFrame (package:flutter_test/src/binding.dart:1454:19)
#402    RendererBinding._handlePersistentFrameCallback (package:flutter/src/rendering/binding.dart:468:5)
#403    SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:1397:15)
#404    SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:1318:9)
#405    AutomatedTestWidgetsFlutterBinding.scheduleWarmUpFrame (package:flutter_test/src/binding.dart:1379:5)
#406    _runWidget (package:flutter/src/widgets/binding.dart:1466:7)
#407    runApp (package:flutter/src/widgets/binding.dart:1399:3)
#408    TestWidgetsFlutterBinding._runTestBody (package:flutter_test/src/binding.dart:1039:7)
<asynchronous suspension>
<asynchronous suspension>
(elided 2 frames from dart:async and package:stack_trace)
════════════════════════════════════════════════════════════════════════════════════════════════════
```

</details>


### Flutter Doctor output

<details><summary>Doctor output</summary>

```console
[√] Flutter (Channel stable, 3.24.3, on Microsoft Windows [Version 10.0.19045.4894], locale pl-PL)
    • Flutter version 3.24.3 on channel stable at C:\Users\kkras\fvm\versions\3.24.3
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 2663184aa7 (13 days ago), 2024-09-11 16:27:48 -0500
    • Engine revision 36335019a8
    • Dart version 3.5.3
    • DevTools version 2.37.3

[√] Windows Version (Installed version of Windows is version 10 or higher)

[√] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at C:\Users\kkras\AppData\Local\Android\Sdk
    • Platform android-35, build-tools 34.0.0
    • ANDROID_HOME = C:\Users\kkras\AppData\Local\Android\Sdk
    • Java binary at: C:\Program Files\Android\Android Studio\jbr\bin\java
    • Java version OpenJDK Runtime Environment (build 17.0.11+0--11852314)
    • All Android licenses accepted.

[X] Chrome - develop for the web (Cannot find Chrome executable at .\Google\Chrome\Application\chrome.exe)
    ! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.

[X] Visual Studio - develop Windows apps
    X Visual Studio not installed; this is necessary to develop Windows apps.
      Download at https://visualstudio.microsoft.com/downloads/.
      Please install the "Desktop development with C++" workload, including all of its default components

[√] Android Studio (version 2024.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 17.0.11+0--11852314)

[√] VS Code (version 1.93.1)
    • VS Code at C:\Users\kkras\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension version 3.96.0

[√] Connected device (2 available)
    • Windows (desktop) • windows • windows-x64    • Microsoft Windows [Version 10.0.19045.4894]
    • Edge (web)        • edge    • web-javascript • Microsoft Edge 129.0.2792.52

[√] Network resources
    • All expected network resources are available.

! Doctor found issues in 2 categories.
```

</details>