Repository: flutter
Issue: [animations] RenderBox was not laid out: RenderFittedBox when using OpenContainer with AppBar inside.
Labels: c: crash,framework,package,p: animations,team-ecosystem,has reproducible steps,P2,triaged-ecosystem,found in release: 3.16,found in release: 3.19

### Steps to reproduce

1. Create a project based on Flutter Gallery -> Motion -> Container Transform demo (https://gallery.flutter.dev/#/demo/motion).
2. Run code (for best results run with a debugger that stops on any unhandled exceptions).
3. Open and close containers a few times

### Expected results

No exception or better explanation why it crashed

### Actual results

Program throws an AssertException with message: 
```
RenderBox was not laid out: RenderFittedBox#2dc52 NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
'package:flutter/src/rendering/box.dart':
Failed assertion: line 1972 pos 12: 'hasSize'
```

### Code sample

<details open><summary>Code sample (taken from Flutter Gallery)</summary>

(This code doesn't seem to throw an exception when run on DartPad. Try copying it and running locally)

```dart
// Copyright 2019 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

import 'package:animations/animations.dart';
import 'package:flutter/material.dart';

const String _loremIpsumParagraph = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod '
    'tempor incididunt ut labore et dolore magna aliqua. Vulputate dignissim '
    'suspendisse in est. Ut ornare lectus sit amet. Eget nunc lobortis mattis '
    'aliquam faucibus purus in. Hendrerit gravida rutrum quisque non tellus '
    'orci ac auctor. Mattis aliquam faucibus purus in massa. Tellus rutrum '
    'tellus pellentesque eu tincidunt tortor. Nunc eget lorem dolor sed. Nulla '
    'at volutpat diam ut venenatis tellus in metus. Tellus cras adipiscing enim '
    'eu turpis. Pretium fusce id velit ut tortor. Adipiscing enim eu turpis '
    'egestas pretium. Quis varius quam quisque id. Blandit aliquam etiam erat '
    'velit scelerisque. In nisl nisi scelerisque eu. Semper risus in hendrerit '
    'gravida rutrum quisque. Suspendisse in est ante in nibh mauris cursus '
    'mattis molestie. Adipiscing elit duis tristique sollicitudin nibh sit '
    'amet commodo nulla. Pretium viverra suspendisse potenti nullam ac tortor '
    'vitae.\n'
    '\n'
    'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod '
    'tempor incididunt ut labore et dolore magna aliqua. Vulputate dignissim '
    'suspendisse in est. Ut ornare lectus sit amet. Eget nunc lobortis mattis '
    'aliquam faucibus purus in. Hendrerit gravida rutrum quisque non tellus '
    'orci ac auctor. Mattis aliquam faucibus purus in massa. Tellus rutrum '
    'tellus pellentesque eu tincidunt tortor. Nunc eget lorem dolor sed. Nulla '
    'at volutpat diam ut venenatis tellus in metus. Tellus cras adipiscing enim '
    'eu turpis. Pretium fusce id velit ut tortor. Adipiscing enim eu turpis '
    'egestas pretium. Quis varius quam quisque id. Blandit aliquam etiam erat '
    'velit scelerisque. In nisl nisi scelerisque eu. Semper risus in hendrerit '
    'gravida rutrum quisque. Suspendisse in est ante in nibh mauris cursus '
    'mattis molestie. Adipiscing elit duis tristique sollicitudin nibh sit '
    'amet commodo nulla. Pretium viverra suspendisse potenti nullam ac tortor '
    'vitae';

const double _fabDimension = 56;

class OpenContainerTransformDemo extends StatefulWidget {
  const OpenContainerTransformDemo({super.key});

  @override
  State<OpenContainerTransformDemo> createState() => _OpenContainerTransformDemoState();
}

class _OpenContainerTransformDemoState extends State<OpenContainerTransformDemo> {
  final GlobalKey<ScaffoldState> _scaffoldKey = GlobalKey<ScaffoldState>();
  ContainerTransitionType _transitionType = ContainerTransitionType.fade;

  void _showSettingsBottomModalSheet(BuildContext context) {
    showModalBottomSheet<void>(
      context: context,
      builder: (context) {
        return StatefulBuilder(
          builder: (context, setModalState) {
            return Container(
              height: 125,
              padding: const EdgeInsets.all(15),
              child: Column(
                crossAxisAlignment: CrossAxisAlignment.start,
                children: [
                  Text(
                    "Bottom modal title",
                    style: Theme.of(context).textTheme.bodySmall,
                  ),
                  const SizedBox(
                    height: 12,
                  ),
                  ToggleButtons(
                    borderRadius: BorderRadius.circular(2),
                    selectedBorderColor: Theme.of(context).colorScheme.primary,
                    onPressed: (index) {
                      setModalState(() {
                        setState(() {
                          _transitionType =
                              index == 0 ? ContainerTransitionType.fade : ContainerTransitionType.fadeThrough;
                        });
                      });
                    },
                    isSelected: <bool>[
                      _transitionType == ContainerTransitionType.fade,
                      _transitionType == ContainerTransitionType.fadeThrough,
                    ],
                    children: [
                      Text(
                        "Transform type fade",
                      ),
                      Padding(
                        padding: const EdgeInsets.symmetric(
                          horizontal: 10,
                        ),
                        child: Text(
                          "Type fadethough",
                        ),
                      ),
                    ],
                  ),
                ],
              ),
            );
          },
        );
      },
    );
  }

  @override
  Widget build(BuildContext context) {
    final colorScheme = Theme.of(context).colorScheme;

    return Navigator(
      // Adding [ValueKey] to make sure that the widget gets rebuilt when
      // changing type.
      key: ValueKey(_transitionType),
      onGenerateRoute: (settings) {
        return MaterialPageRoute<void>(
          builder: (context) => Scaffold(
            key: _scaffoldKey,
            appBar: AppBar(
              automaticallyImplyLeading: false,
              title: Column(
                children: [
                  Text(
                    "Demo Container transform title",
                  ),
                  Text(
                    '(Demo transform instructions)',
                    style: Theme.of(context).textTheme.titleSmall!.copyWith(color: Colors.white),
                  ),
                ],
              ),
              actions: [
                IconButton(
                  icon: const Icon(
                    Icons.settings,
                  ),
                  onPressed: () {
                    _showSettingsBottomModalSheet(context);
                  },
                ),
              ],
            ),
            body: ListView(
              padding: const EdgeInsets.all(8),
              children: [
                _OpenContainerWrapper(
                  transitionType: _transitionType,
                  closedBuilder: (context, openContainer) {
                    return _DetailsCard(openContainer: openContainer);
                  },
                ),
                const SizedBox(height: 16),
                _OpenContainerWrapper(
                  transitionType: _transitionType,
                  closedBuilder: (context, openContainer) {
                    return _DetailsListTile(openContainer: openContainer);
                  },
                ),
                const SizedBox(
                  height: 16,
                ),
                Row(
                  children: [
                    Expanded(
                      child: _OpenContainerWrapper(
                        transitionType: _transitionType,
                        closedBuilder: (context, openContainer) {
                          return _SmallDetailsCard(
                            openContainer: openContainer,
                            subtitle: "Demo motion placeholder subtitle",
                          );
                        },
                      ),
                    ),
                    const SizedBox(
                      width: 8,
                    ),
                    Expanded(
                      child: _OpenContainerWrapper(
                        transitionType: _transitionType,
                        closedBuilder: (context, openContainer) {
                          return _SmallDetailsCard(
                            openContainer: openContainer,
                            subtitle: "Demo motion placeholder subtitle",
                          );
                        },
                      ),
                    ),
                  ],
                ),
                const SizedBox(
                  height: 16,
                ),
                Row(
                  children: [
                    Expanded(
                      child: _OpenContainerWrapper(
                        transitionType: _transitionType,
                        closedBuilder: (context, openContainer) {
                          return _SmallDetailsCard(
                            openContainer: openContainer,
                            subtitle: "Small subtitle",
                          );
                        },
                      ),
                    ),
                    const SizedBox(
                      width: 8,
                    ),
                    Expanded(
                      child: _OpenContainerWrapper(
                        transitionType: _transitionType,
                        closedBuilder: (context, openContainer) {
                          return _SmallDetailsCard(
                            openContainer: openContainer,
                            subtitle: "Small placeholder subtitle",
                          );
                        },
                      ),
                    ),
                    const SizedBox(
                      width: 8,
                    ),
                    Expanded(
                      child: _OpenContainerWrapper(
                        transitionType: _transitionType,
                        closedBuilder: (context, openContainer) {
                          return _SmallDetailsCard(
                            openContainer: openContainer,
                            subtitle: "Small placeholder subtitle",
                          );
                        },
                      ),
                    ),
                  ],
                ),
                const SizedBox(
                  height: 16,
                ),
                ...List.generate(10, (index) {
                  return OpenContainer<bool>(
                    transitionType: _transitionType,
                    openBuilder: (context, openContainer) => const _DetailsPage(),
                    tappable: false,
                    closedShape: const RoundedRectangleBorder(),
                    closedElevation: 0,
                    closedBuilder: (context, openContainer) {
                      return ListTile(
                        leading: Image.asset(
                          'placeholders/avatar_logo.png',
                          package: 'flutter_gallery_assets',
                          width: 40,
                        ),
                        onTap: openContainer,
                        title: Text(
                          'Demo motion subtitle ${index + 1}',
                        ),
                        subtitle: Text(
                          "Demo motion placeholder subtitle",
                        ),
                      );
                    },
                  );
                }),
              ],
            ),
            floatingActionButton: OpenContainer(
              transitionType: _transitionType,
              openBuilder: (context, openContainer) => const _DetailsPage(),
              closedElevation: 6,
              closedShape: const RoundedRectangleBorder(
                borderRadius: BorderRadius.all(
                  Radius.circular(_fabDimension / 2),
                ),
              ),
              closedColor: colorScheme.secondary,
              closedBuilder: (context, openContainer) {
                return SizedBox(
                  height: _fabDimension,
                  width: _fabDimension,
                  child: Center(
                    child: Icon(
                      Icons.add,
                      color: colorScheme.onSecondary,
                    ),
                  ),
                );
              },
            ),
          ),
        );
      },
    );
  }
}

class _OpenContainerWrapper extends StatelessWidget {
  const _OpenContainerWrapper({
    required this.closedBuilder,
    required this.transitionType,
  });

  final CloseContainerBuilder closedBuilder;
  final ContainerTransitionType transitionType;

  @override
  Widget build(BuildContext context) {
    return OpenContainer<bool>(
      transitionType: transitionType,
      openBuilder: (context, openContainer) => const _DetailsPage(),
      tappable: false,
      closedBuilder: closedBuilder,
    );
  }
}

class _DetailsCard extends StatelessWidget {
  const _DetailsCard({required this.openContainer});

  final VoidCallback openContainer;

  @override
  Widget build(BuildContext context) {
    return _InkWellOverlay(
      openContainer: openContainer,
      height: 300,
      child: Column(
        crossAxisAlignment: CrossAxisAlignment.stretch,
        children: [
          Expanded(
            child: Container(
              color: Colors.black38,
              child: Center(child: Text("Image asset")),
            ),
          ),
          ListTile(
            title: Text(
              "Demo motion placeholder title",
            ),
            subtitle: Text(
              "Demo motion placeholder subtitle",
            ),
          ),
          Padding(
            padding: const EdgeInsets.only(
              left: 16,
              right: 16,
              bottom: 16,
            ),
            child: Text(
              'Lorem ipsum dolor sit amet, consectetur '
              'adipiscing elit, sed do eiusmod tempor.',
              style: Theme.of(context).textTheme.bodyMedium!.copyWith(
                    color: Colors.black54,
                    inherit: false,
                  ),
            ),
          ),
        ],
      ),
    );
  }
}

class _SmallDetailsCard extends StatelessWidget {
  const _SmallDetailsCard({
    required this.openContainer,
    required this.subtitle,
  });

  final VoidCallback openContainer;
  final String subtitle;

  @override
  Widget build(BuildContext context) {
    final textTheme = Theme.of(context).textTheme;

    return _InkWellOverlay(
      openContainer: openContainer,
      height: 225,
      child: Column(
        crossAxisAlignment: CrossAxisAlignment.start,
        children: [
          Container(
            color: Colors.black38,
            height: 150,
            child: Center(
              child: Text("Image asset"),
            ),
          ),
          Expanded(
            child: Padding(
              padding: const EdgeInsets.all(10),
              child: Column(
                mainAxisAlignment: MainAxisAlignment.center,
                crossAxisAlignment: CrossAxisAlignment.start,
                children: [
                  Text(
                    "Demomotion placeholder title",
                    style: textTheme.titleLarge,
                  ),
                  const SizedBox(
                    height: 4,
                  ),
                  Text(
                    subtitle,
                    style: textTheme.bodySmall,
                  ),
                ],
              ),
            ),
          ),
        ],
      ),
    );
  }
}

class _DetailsListTile extends StatelessWidget {
  const _DetailsListTile({required this.openContainer});

  final VoidCallback openContainer;

  @override
  Widget build(BuildContext context) {
    final textTheme = Theme.of(context).textTheme;
    const height = 120.0;

    return _InkWellOverlay(
      openContainer: openContainer,
      height: height,
      child: Row(
        children: [
          Container(
            color: Colors.black38,
            height: height,
            width: height,
            child: Center(child: Text("Image asset")),
          ),
          Expanded(
            child: Padding(
              padding: const EdgeInsets.all(20),
              child: Column(
                crossAxisAlignment: CrossAxisAlignment.start,
                children: [
                  Text(
                    "TEST",
                    style: textTheme.titleMedium,
                  ),
                  const SizedBox(
                    height: 8,
                  ),
                  Text(
                    'Lorem ipsum dolor sit amet, consectetur '
                    'adipiscing elit,',
                    style: textTheme.bodySmall,
                  ),
                ],
              ),
            ),
          ),
        ],
      ),
    );
  }
}

class _InkWellOverlay extends StatelessWidget {
  const _InkWellOverlay({
    required this.openContainer,
    required this.height,
    required this.child,
  });

  final VoidCallback openContainer;
  final double height;
  final Widget child;

  @override
  Widget build(BuildContext context) {
    return SizedBox(
      height: height,
      child: InkWell(
        onTap: openContainer,
        child: child,
      ),
    );
  }
}

class _DetailsPage extends StatelessWidget {
  const _DetailsPage();

  @override
  Widget build(BuildContext context) {
    final textTheme = Theme.of(context).textTheme;

    return Scaffold(
      appBar: AppBar(
        title: Text(
          "Demo motion page title",
        ),
      ),
      body: ListView(
        children: [
          Container(
            color: Colors.black38,
            height: 250,
            child: Padding(padding: const EdgeInsets.all(70), child: Text("Image asset")),
          ),
          Padding(
            padding: const EdgeInsets.all(20),
            child: Column(
              crossAxisAlignment: CrossAxisAlignment.start,
              children: [
                Text(
                  "Demo motion placeholder title",
                  style: textTheme.headlineSmall!.copyWith(
                    color: Colors.black54,
                    fontSize: 30,
                  ),
                ),
                const SizedBox(
                  height: 10,
                ),
                Text(
                  _loremIpsumParagraph,
                  style: textTheme.bodyMedium!.copyWith(
                    color: Colors.black54,
                    height: 1.5,
                    fontSize: 16,
                  ),
                ),
              ],
            ),
          ),
        ],
      ),
    );
  }
}


void main() {
  runApp(const MainApp());
}

class MainApp extends StatelessWidget {
  const MainApp({super.key});

  @override
  Widget build(BuildContext context) {
    return const MaterialApp(
      home: Scaffold(
        body: OpenContainerTransformDemo(),
      ),
    );
  }
}

```
</details>


### Screenshots or Video

<details open>
<summary>Screenshots / Video demonstration</summary>

https://github.com/flutter/flutter/assets/39161575/9a86505e-c672-4117-a776-cc3a12e67d37

</details>


### Logs

<details open><summary>Logs</summary>

```console
══╡ EXCEPTION CAUGHT BY WIDGETS LIBRARY ╞═══════════════════════════════════════════════════════════
                    The following assertion was thrown building Builder(dirty):
                    RenderBox was not laid out: RenderFittedBox#67a2b NEEDS-LAYOUT NEEDS-PAINT
                    NEEDS-COMPOSITING-BITS-UPDATE
                    'package:flutter/src/rendering/box.dart':
                    Failed assertion: line 1972 pos 12: 'hasSize'

                    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.yml

                    The relevant error-causing widget was:
                      AppBar AppBar:file:///C:/Users/Minik/temp/flutter_temp/lib/details.dart:500:15

                    When the exception was thrown, this was the stack:
                    #2      RenderBox.size (package:flutter/src/rendering/box.dart:1972:12)
                    #3      RenderFittedBox.paintsChild (package:flutter/src/rendering/proxy_box.dart:2839:13)
                    #4      RenderFittedBox.applyPaintTransform (package:flutter/src/rendering/proxy_box.dart:2844:10)
                    #5      RenderObject.getTransformTo (package:flutter/src/rendering/object.dart:3323:24)
                    #6      RenderBox.localToGlobal (package:flutter/src/rendering/box.dart:2619:39)
                    #7      TooltipState._buildTooltipOverlay (package:flutter/src/material/tooltip.dart:729:31)
                    #8      Builder.build (package:flutter/src/widgets/basic.dart:7682:48)
                    #9      StatelessElement.build (package:flutter/src/widgets/framework.dart:5541:49)
                    #10     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5471:15)
                    #11     Element.rebuild (package:flutter/src/widgets/framework.dart:5187:7)
                    #12     StatelessElement.update (package:flutter/src/widgets/framework.dart:5547:5)
                    #13     Element.updateChild (package:flutter/src/widgets/framework.dart:3815:15)
                    #14     SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:6743:14)
                    #15     Element.updateChild (package:flutter/src/widgets/framework.dart:3815:15)
                    #16     _OverlayPortalElement.update (package:flutter/src/widgets/overlay.dart:1898:21)
                    #17     Element.updateChild (package:flutter/src/widgets/framework.dart:3815:15)
                    #18     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5496:16)
                    #19     StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:5634:11)
                    #20     Element.rebuild (package:flutter/src/widgets/framework.dart:5187:7)
                    #21     StatefulElement.update (package:flutter/src/widgets/framework.dart:5657:5)
                    #22     Element.updateChild (package:flutter/src/widgets/framework.dart:3815:15)
                    #23     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5496:16)
                    #24     StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:5634:11)
                    #25     Element.rebuild (package:flutter/src/widgets/framework.dart:5187:7)
                    #26     StatefulElement.update (package:flutter/src/widgets/framework.dart:5657:5)
                    #27     Element.updateChild (package:flutter/src/widgets/framework.dart:3815:15)
                    #28     SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:6743:14)
                    #29     Element.updateChild (package:flutter/src/widgets/framework.dart:3815:15)
                    #30     SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:6743:14)
                    #31     Element.updateChild (package:flutter/src/widgets/framework.dart:3815:15)
                    #32     SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:6743:14)
                    #33     Element.updateChild (package:flutter/src/widgets/framework.dart:3815:15)
                    #34     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5496:16)
                    #35     Element.rebuild (package:flutter/src/widgets/framework.dart:5187:7)
                    #36     ProxyElement.update (package:flutter/src/widgets/framework.dart:5800:5)
                    #37     Element.updateChild (package:flutter/src/widgets/framework.dart:3815:15)
                    #38     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5496:16)
                    #39     Element.rebuild (package:flutter/src/widgets/framework.dart:5187:7)
                    #40     StatelessElement.update (package:flutter/src/widgets/framework.dart:5547:5)
                    #41     Element.updateChild (package:flutter/src/widgets/framework.dart:3815:15)
                    #42     SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:6743:14)
                    #43     Element.updateChild (package:flutter/src/widgets/framework.dart:3815:15)
                    #44     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5496:16)
                    #45     StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:5634:11)
                    #46     Element.rebuild (package:flutter/src/widgets/framework.dart:5187:7)
                    #47     StatefulElement.update (package:flutter/src/widgets/framework.dart:5657:5)
                    #48     Element.updateChild (package:flutter/src/widgets/framework.dart:3815:15)
                    #49     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5496:16)
                    #50     Element.rebuild (package:flutter/src/widgets/framework.dart:5187:7)
                    #51     StatelessElement.update (package:flutter/src/widgets/framework.dart:5547:5)
                    #52     Element.updateChild (package:flutter/src/widgets/framework.dart:3815:15)
                    #53     SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:6743:14)
                    #54     Element.updateChild (package:flutter/src/widgets/framework.dart:3815:15)
                    #55     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5496:16)
                    #56     Element.rebuild (package:flutter/src/widgets/framework.dart:5187:7)
                    #57     ProxyElement.update (package:flutter/src/widgets/framework.dart:5800:5)
                    #58     Element.updateChild (package:flutter/src/widgets/framework.dart:3815:15)
                    #59     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5496:16)
                    #60     Element.rebuild (package:flutter/src/widgets/framework.dart:5187:7)
                    #61     StatelessElement.update (package:flutter/src/widgets/framework.dart:5547:5)
                    #62     Element.updateChild (package:flutter/src/widgets/framework.dart:3815:15)
                    #63     SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:6743:14)
                    #64     Element.updateChild (package:flutter/src/widgets/framework.dart:3815:15)
                    #65     SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:6743:14)
                    #66     Element.updateChild (package:flutter/src/widgets/framework.dart:3815:15)
                    #67     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5496:16)
                    #68     Element.rebuild (package:flutter/src/widgets/framework.dart:5187:7)
                    #69     ProxyElement.update (package:flutter/src/widgets/framework.dart:5800:5)
                    #70     _InheritedNotifierElement.update (package:flutter/src/widgets/inherited_notifier.dart:105:11)
                    #71     Element.updateChild (package:flutter/src/widgets/framework.dart:3815:15)
                    #72     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5496:16)
                    #73     StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:5634:11)
                    #74     Element.rebuild (package:flutter/src/widgets/framework.dart:5187:7)
                    #75     StatefulElement.update (package:flutter/src/widgets/framework.dart:5657:5)
                    #76     Element.updateChild (package:flutter/src/widgets/framework.dart:3815:15)
                    #77     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5496:16)
                    #78     Element.rebuild (package:flutter/src/widgets/framework.dart:5187:7)
                    #79     ProxyElement.update (package:flutter/src/widgets/framework.dart:5800:5)
                    #80     Element.updateChild (package:flutter/src/widgets/framework.dart:3815:15)
                    #81     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5496:16)
                    #82     StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:5634:11)
                    #83     Element.rebuild (package:flutter/src/widgets/framework.dart:5187:7)
                    #84     StatefulElement.update (package:flutter/src/widgets/framework.dart:5657:5)
                    #85     Element.updateChild (package:flutter/src/widgets/framework.dart:3815:15)
                    #86     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5496:16)
                    #87     Element.rebuild (package:flutter/src/widgets/framework.dart:5187:7)
                    #88     ProxyElement.update (package:flutter/src/widgets/framework.dart:5800:5)
                    #89     Element.updateChild (package:flutter/src/widgets/framework.dart:3815:15)
                    #90     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5496:16)
                    #91     StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:5634:11)
                    #92     Element.rebuild (package:flutter/src/widgets/framework.dart:5187:7)
                    #93     StatefulElement.update (package:flutter/src/widgets/framework.dart:5657:5)
                    #94     Element.updateChild (package:flutter/src/widgets/framework.dart:3815:15)
                    #95     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5496:16)
                    #96     Element.rebuild (package:flutter/src/widgets/framework.dart:5187:7)
                    #97     StatelessElement.update (package:flutter/src/widgets/framework.dart:5547:5)
                    #98     Element.updateChild (package:flutter/src/widgets/framework.dart:3815:15)
                    #99     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5496:16)
                    #100    Element.rebuild (package:flutter/src/widgets/framework.dart:5187:7)
                    #101    ProxyElement.update (package:flutter/src/widgets/framework.dart:5800:5)
                    #102    Element.updateChild (package:flutter/src/widgets/framework.dart:3815:15)
                    #103    ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5496:16)
                    #104    StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:5634:11)
                    #105    Element.rebuild (package:flutter/src/widgets/framework.dart:5187:7)
                    #106    StatefulElement.update (package:flutter/src/widgets/framework.dart:5657:5)
                    #107    Element.updateChild (package:flutter/src/widgets/framework.dart:3815:15)
                    #108    SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:6743:14)
                    #109    Element.updateChild (package:flutter/src/widgets/framework.dart:3815:15)
                    #110    ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5496:16)
                    #111    Element.rebuild (package:flutter/src/widgets/framework.dart:5187:7)
                    #112    ProxyElement.update (package:flutter/src/widgets/framework.dart:5800:5)
                    #113    Element.updateChild (package:flutter/src/widgets/framework.dart:3815:15)
                    #114    SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:6743:14)
                    #115    Element.updateChild (package:flutter/src/widgets/framework.dart:3815:15)
                    #116    ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5496:16)
                    #117    Element.rebuild (package:flutter/src/widgets/framework.dart:5187:7)
                    #118    StatelessElement.update (package:flutter/src/widgets/framework.dart:5547:5)
                    #119    Element.updateChild (package:flutter/src/widgets/framework.dart:3815:15)
                    #120    SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:6743:14)
                    #121    Element.updateChild (package:flutter/src/widgets/framework.dart:3815:15)
                    #122    ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5496:16)
                    #123    StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:5634:11)
                    #124    Element.rebuild (package:flutter/src/widgets/framework.dart:5187:7)
                    #125    StatefulElement.update (package:flutter/src/widgets/framework.dart:5657:5)
                    #126    Element.updateChild (package:flutter/src/widgets/framework.dart:3815:15)
                    #127    ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5496:16)
                    #128    StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:5634:11)
                    #129    Element.rebuild (package:flutter/src/widgets/framework.dart:5187:7)
                    #130    StatefulElement.update (package:flutter/src/widgets/framework.dart:5657:5)
                    #131    Element.updateChild (package:flutter/src/widgets/framework.dart:3815:15)
                    #132    SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:6743:14)
                    #133    Element.updateChild (package:flutter/src/widgets/framework.dart:3815:15)
                    #134    SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:6743:14)
                    #135    Element.updateChild (package:flutter/src/widgets/framework.dart:3815:15)
                    #136    SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:6743:14)
                    #137    Element.updateChild (package:flutter/src/widgets/framework.dart:3815:15)
                    #138    ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5496:16)
                    #139    StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:5634:11)
                    #140    Element.rebuild (package:flutter/src/widgets/framework.dart:5187:7)
                    #141    StatefulElement.update (package:flutter/src/widgets/framework.dart:5657:5)
                    #142    Element.updateChild (package:flutter/src/widgets/framework.dart:3815:15)
                    #143    ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5496:16)
                    #144    StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:5634:11)
                    #145    Element.rebuild (package:flutter/src/widgets/framework.dart:5187:7)
                    #146    StatefulElement.update (package:flutter/src/widgets/framework.dart:5657:5)
                    #147    Element.updateChild (package:flutter/src/widgets/framework.dart:3815:15)
                    #148    ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5496:16)
                    #149    Element.rebuild (package:flutter/src/widgets/framework.dart:5187:7)
                    #150    StatelessElement.update (package:flutter/src/widgets/framework.dart:5547:5)
                    #151    Element.updateChild (package:flutter/src/widgets/framework.dart:3815:15)
                    #152    ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5496:16)
                    #153    Element.rebuild (package:flutter/src/widgets/framework.dart:5187:7)
                    #154    BuildOwner.buildScope (package:flutter/src/widgets/framework.dart:2895:19)
                    #155    WidgetsBinding.drawFrame (package:flutter/src/widgets/binding.dart:984:21)
                    #156    RendererBinding._handlePersistentFrameCallback (package:flutter/src/rendering/binding.dart:457:5)
                    #157    SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:1325:15)
                    #158    SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:1255:9)
                    #159    SchedulerBinding._handleDrawFrame (package:flutter/src/scheduler/binding.dart:1113:5)
                    #160    _invoke (dart:ui/hooks.dart:312:13)
                    #161    PlatformDispatcher._drawFrame (dart:ui/platform_dispatcher.dart:383:5)
                    #162    _drawFrame (dart:ui/hooks.dart:283:31)
                    (elided 2 frames from class _AssertionError)
       ════════════════════════════════════════════════════════════════════════════════════════════════════
```

</details>


### Flutter Doctor output

<details open><summary>Doctor output</summary>

```console
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 3.16.7, on Microsoft Windows [Version 10.0.22631.3007], locale pl-PL)
[√] Windows Version (Installed version of Windows is version 10 or higher)
[√] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
[√] Chrome - develop for the web
[√] Visual Studio - develop Windows apps (Visual Studio Community 2022 17.8.3)
[√] Android Studio (version 2023.1)
[√] VS Code (version 1.85.1)
[√] Connected device (3 available)
[√] Network resources

• No issues found!
```

</details>