Failed assertion: line 2283 pos 14: '_debugSubtreeRelayoutRootAlreadyMarkedNeedsLayout()': is not true

Steps to reproduce
I have attached a sample code to reproduce the bug. Click the "crash me!" button twice. This issue seems to disappear when the layout builder is removed.
Expected results
The counter should increment without any crashes.
Actual results
A crash occurs.
Code sample
Code sample
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:go_router/go_router.dart';

final GlobalKey<NavigatorState> _rootNavigatorKey =
    GlobalKey<NavigatorState>(debugLabel: 'root');
final GlobalKey<NavigatorState> _sectionANavigatorKey =
    GlobalKey<NavigatorState>(debugLabel: 'sectionANav');

class BlocState {
  final int counter;

  BlocState(this.counter);
}

class BlocEvent {
  final int counter;

  BlocEvent(this.counter);
}

class BlocCounter extends Bloc<BlocEvent, BlocState> {
  BlocCounter() : super(BlocState(0)) {
    on<BlocEvent>(_changeCounter);
  }

  _changeCounter(BlocEvent event, Emitter<BlocState> emit) {
    emit(BlocState(event.counter));
  }
}

final blocInstance = BlocCounter();

void main() {
  runApp(NestedTabNavigationExampleApp());
}

/// An example demonstrating how to use nested navigators
class NestedTabNavigationExampleApp extends StatelessWidget {
  /// Creates a NestedTabNavigationExampleApp
  NestedTabNavigationExampleApp({super.key});

  final GoRouter _router = GoRouter(
    navigatorKey: _rootNavigatorKey,
    initialLocation: '/a/details',
    routes: <RouteBase>[
      StatefulShellRoute.indexedStack(
        builder: (BuildContext context, GoRouterState state,
            StatefulNavigationShell navigationShell) {
          // Return the widget that implements the custom shell (in this case
          // using a BottomNavigationBar). The StatefulNavigationShell is passed
          // to be able access the state of the shell and to navigate to other
          // branches in a stateful way.
          return ScaffoldWithNavBar(navigationShell: navigationShell);
        },
        branches: <StatefulShellBranch>[
          // The route branch for the first tab of the bottom navigation bar.
          StatefulShellBranch(
            navigatorKey: _sectionANavigatorKey,
            routes: <RouteBase>[
              GoRoute(
                // The screen to display as the root in the first tab of the
                // bottom navigation bar.
                path: '/a',
                builder: (BuildContext context, GoRouterState state) =>
                    const RootScreen(label: 'A', detailsPath: '/a/details'),
                routes: <RouteBase>[
                  // The details screen to display stacked on navigator of the
                  // first tab. This will cover screen A but not the application
                  // shell (bottom navigation bar).
                  GoRoute(
                    path: 'details',
                    builder: (BuildContext context, GoRouterState state) =>
                        const DetailsScreen(label: 'A'),
                  ),
                ],
              ),
            ],
          ),

          // The route branch for the second tab of the bottom navigation bar.
          StatefulShellBranch(
            // It's not necessary to provide a navigatorKey if it isn't also
            // needed elsewhere. If not provided, a default key will be used.
            routes: <RouteBase>[
              GoRoute(
                // The screen to display as the root in the second tab of the
                // bottom navigation bar.
                path: '/b',
                builder: (BuildContext context, GoRouterState state) =>
                    const RootScreen(
                  label: 'B',
                  detailsPath: '/b/details/1',
                  secondDetailsPath: '/b/details/2',
                ),
                routes: <RouteBase>[
                  GoRoute(
                    path: 'details/:param',
                    builder: (BuildContext context, GoRouterState state) =>
                        DetailsScreen(
                      label: 'B',
                      param: state.pathParameters['param'],
                    ),
                  ),
                ],
              ),
            ],
          ),

          // The route branch for the third tab of the bottom navigation bar.
          StatefulShellBranch(
            routes: <RouteBase>[
              GoRoute(
                // The screen to display as the root in the third tab of the
                // bottom navigation bar.
                path: '/c',
                builder: (BuildContext context, GoRouterState state) =>
                    const RootScreen(
                  label: 'C',
                  detailsPath: '/c/details',
                ),
                routes: <RouteBase>[
                  GoRoute(
                    path: 'details',
                    builder: (BuildContext context, GoRouterState state) =>
                        DetailsScreen(
                      label: 'C',
                      extra: state.extra,
                    ),
                  ),
                ],
              ),
            ],
          ),
        ],
      ),
    ],
  );

  @override
  Widget build(BuildContext context) {
    return BlocProvider(
      create: (context) => blocInstance,
      child: MaterialApp.router(
        title: 'Flutter Demo',
        theme: ThemeData(
          primarySwatch: Colors.blue,
        ),
        routerConfig: _router,
      ),
    );
  }
}

/// Builds the "shell" for the app by building a Scaffold with a
/// BottomNavigationBar, where [child] is placed in the body of the Scaffold.
class ScaffoldWithNavBar extends StatelessWidget {
  /// Constructs an [ScaffoldWithNavBar].
  const ScaffoldWithNavBar({
    required this.navigationShell,
    Key? key,
  }) : super(key: key ?? const ValueKey<String>('ScaffoldWithNavBar'));

  /// The navigation shell and container for the branch Navigators.
  final StatefulNavigationShell navigationShell;

  @override
  Widget build(BuildContext context) {
    final counterState = context.watch<BlocCounter>().state;

    return LayoutBuilder(
      builder: (BuildContext context, BoxConstraints constraint) {
        double width = constraint.maxWidth;

        final Widget narrowContent = ConstrainedBox(
          constraints: BoxConstraints(
            minHeight: MediaQuery.of(context).size.height,
          ),
          child: navigationShell,
        );

        late final Widget body;
        if (counterState.counter.isEven) {
          body = Stack(children: [
            Positioned.fill(child: narrowContent),
          ]);
        } else {
          body = Column(children: [Expanded(child: narrowContent)]);
        }

        final Widget rightArea = SafeArea(
          // key: const Key('right_area'),
          child: Align(
            alignment: Alignment.center,
            child: ConstrainedBox(
              constraints: const BoxConstraints(
                maxWidth: 800,
              ),
              child: body,
            ),
          ),
        );

        return Scaffold(
          body: rightArea,
          bottomNavigationBar: BottomNavigationBar(
            // Here, the items of BottomNavigationBar are hard coded. In a real
            // world scenario, the items would most likely be generated from the
            // branches of the shell route, which can be fetched using
            // `navigationShell.route.branches`.
            items: const <BottomNavigationBarItem>[
              BottomNavigationBarItem(
                  icon: Icon(Icons.home), label: 'Section A'),
              BottomNavigationBarItem(
                  icon: Icon(Icons.work), label: 'Section B'),
              BottomNavigationBarItem(
                  icon: Icon(Icons.tab), label: 'Section C'),
            ],
            currentIndex: navigationShell.currentIndex,
            onTap: (int index) => _onTap(context, index),
          ),
        );
      },
    );
  }

  /// Navigate to the current location of the branch at the provided index when
  /// tapping an item in the BottomNavigationBar.
  void _onTap(BuildContext context, int index) {
    // When navigating to a new branch, it's recommended to use the goBranch
    // method, as doing so makes sure the last navigation state of the
    // Navigator for the branch is restored.
    navigationShell.goBranch(
      index,
      // A common pattern when using bottom navigation bars is to support
      // navigating to the initial location when tapping the item that is
      // already active. This example demonstrates how to support this behavior,
      // using the initialLocation parameter of goBranch.
      initialLocation: index == navigationShell.currentIndex,
    );
  }
}

/// Widget for the root/initial pages in the bottom navigation bar.
class RootScreen extends StatelessWidget {
  /// Creates a RootScreen
  const RootScreen({
    required this.label,
    required this.detailsPath,
    this.secondDetailsPath,
    super.key,
  });

  /// The label
  final String label;

  /// The path to the detail page
  final String detailsPath;

  /// The path to another detail page
  final String? secondDetailsPath;

  @override
  Widget build(BuildContext context) {
    final counterState = context.watch<BlocCounter>().state;

    if (counterState.counter.isEven) {
      return Scaffold(body: const CircularProgressIndicator());
    } else {
      return Text('Screen $label',
          style: Theme.of(context).textTheme.titleLarge);
    }
  }
}

/// The details screen for either the A or B screen.
class DetailsScreen extends StatefulWidget {
  /// Constructs a [DetailsScreen].
  const DetailsScreen({
    required this.label,
    this.param,
    this.extra,
    this.withScaffold = true,
    super.key,
  });

  /// The label to display in the center of the screen.
  final String label;

  /// Optional param
  final String? param;

  /// Optional extra object
  final Object? extra;

  /// Wrap in scaffold
  final bool withScaffold;

  @override
  State<StatefulWidget> createState() => DetailsScreenState();
}

/// The state for DetailsScreen
class DetailsScreenState extends State<DetailsScreen> {
  int _counter = 0;

  @override
  Widget build(BuildContext context) {
    if (widget.withScaffold) {
      return Scaffold(
        appBar: AppBar(
          title: Text('Details Screen - ${widget.label}'),
        ),
        body: _build(context),
      );
    } else {
      return ColoredBox(
        color: Theme.of(context).scaffoldBackgroundColor,
        child: _build(context),
      );
    }
  }

  Widget _build(BuildContext context) {
    final counterState = context.watch<BlocCounter>().state;

    return Center(
      child: Column(
        mainAxisSize: MainAxisSize.min,
        children: <Widget>[
          Text('Details for ${widget.label} - Counter: ${counterState.counter}',
              style: Theme.of(context).textTheme.titleLarge),
          const Padding(padding: EdgeInsets.all(4)),
          TextButton(
            onPressed: () {
              setState(() {
                blocInstance.add(BlocEvent(blocInstance.state.counter + 1));
              });
            },
            child: const Text('Crash me!'),
          ),
          const Padding(padding: EdgeInsets.all(8)),
          if (widget.param != null)
            Text('Parameter: ${widget.param!}',
                style: Theme.of(context).textTheme.titleMedium),
          const Padding(padding: EdgeInsets.all(8)),
          if (widget.extra != null)
            Text('Extra: ${widget.extra!}',
                style: Theme.of(context).textTheme.titleMedium),
          if (!widget.withScaffold) ...<Widget>[
            const Padding(padding: EdgeInsets.all(16)),
            TextButton(
              onPressed: () {
                GoRouter.of(context).pop();
              },
              child: const Text('< Back',
                  style: TextStyle(fontWeight: FontWeight.bold, fontSize: 18)),
            ),
          ]
        ],
      ),
    );
  }
}

Pubspec
name: go_router_bug
description: "A new Flutter project."

# Prevent accidental publishing to pub.dev.
publish_to: 'none'

version: 1.0.0+1

environment:
  sdk: '>=3.3.4 <4.0.0'

dependencies:
  go_router: ^14.0.0
  flutter_bloc: ^8.1.5
  flutter:
    sdk: flutter
  flutter_localizations:
    sdk: flutter

dev_dependencies:
  flutter_test:
    sdk: flutter

  flutter_lints: ^3.0.0

flutter:
  uses-material-design: true

  # Enable generation of localized Strings from arb files.
  generate: true

  assets:
    # Add assets from the images directory to the application.
    - assets/images/

Screenshots or Video

Screenshots / Video demonstration
[Upload media here]

Logs
Logs
======== Exception caught by widgets library =======================================================
The following assertion was thrown building RootScreen(dependencies: [_InheritedProviderScope<BlocCounter?>, _InheritedTheme, _LocalizationsScope-[GlobalKey#10e8b]]):
'package:flutter/src/rendering/object.dart': Failed assertion: line 2283 pos 14: '_debugSubtreeRelayoutRootAlreadyMarkedNeedsLayout()': is not true.

Either the assertion indicates an error in the framework itself, or we should provide substantially more information in this error message to help you determine and fix the underlying cause.
In either case, please report this assertion by filing a bug on GitHub:
  https://github.com/flutter/flutter/issues/new?template=2_bug.yml

The relevant error-causing widget was:
  RootScreen RootScreen:file:///Users/shady/Projects/go_router_bug/lib/main.dart:66:27
When the exception was thrown, this was the stack:
#2      RenderObject.markNeedsLayout (package:flutter/src/rendering/object.dart:2283:14)
#3      RenderBox.markNeedsLayout (package:flutter/src/rendering/box.dart:2379:11)
#4      RenderObject.dropChild (package:flutter/src/rendering/object.dart:1863:5)
#5      RenderObjectWithChildMixin.child= (package:flutter/src/rendering/object.dart:4051:7)
#6      SingleChildRenderObjectElement.removeRenderObjectChild (package:flutter/src/widgets/framework.dart:6787:18)
#7      RenderObjectElement.detachRenderObject (package:flutter/src/widgets/framework.dart:6601:37)
#8      Element.detachRenderObject.<anonymous closure> (package:flutter/src/widgets/framework.dart:4202:13)
#9      ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5532:14)
#10     Element.detachRenderObject (package:flutter/src/widgets/framework.dart:4201:5)
#11     Element.deactivateChild (package:flutter/src/widgets/framework.dart:4376:11)
#12     Element.updateChild (package:flutter/src/widgets/framework.dart:3835:9)
#13     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5505:16)
#14     Element.rebuild (package:flutter/src/widgets/framework.dart:5196:7)
#15     BuildOwner.buildScope (package:flutter/src/widgets/framework.dart:2904:19)
#16     WidgetsBinding.drawFrame (package:flutter/src/widgets/binding.dart:989:21)
#17     RendererBinding._handlePersistentFrameCallback (package:flutter/src/rendering/binding.dart:448:5)
#18     SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:1386:15)
#19     SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:1311:9)
#20     SchedulerBinding._handleDrawFrame (package:flutter/src/scheduler/binding.dart:1169:5)
#21     _invoke (dart:ui/hooks.dart:312:13)
#22     PlatformDispatcher._drawFrame (dart:ui/platform_dispatcher.dart:399:5)
#23     _drawFrame (dart:ui/hooks.dart:283:31)
(elided 2 frames from class _AssertionError)
====================================================================================================

Flutter Doctor output
Doctor output
flutter doctor -v
[✓] Flutter (Channel stable, 3.19.6, on macOS 14.4.1 23E224 darwin-x64, locale en-AU)
    • Flutter version 3.19.6 on channel stable at /Applications/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 54e66469a9 (9 days ago), 2024-04-17 13:08:03 -0700
    • Engine revision c4cd48e186
    • Dart version 3.3.4
    • DevTools version 2.31.1

[✓] Android toolchain - develop for Android devices (Android SDK version 32.1.0-rc1)
    • Android SDK at /Users/shady/Library/Android/sdk
    • Platform android-33, build-tools 32.1.0-rc1
    • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.11+0-b60-7590822)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 15.2)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 15C500b
    • CocoaPods version 1.15.2

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2021.1)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.11+0-b60-7590822)

[✓] IntelliJ IDEA Ultimate Edition (version 2024.1)
    • IntelliJ at /Users/shady/Applications/IntelliJ IDEA Ultimate.app
    • Flutter plugin version 79.0.3
    • Dart plugin version 241.15845

[✓] VS Code (version 1.88.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension can be installed from:
      🔨 https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter

[✓] VS Code (version 1.86.0-insider)
    • VS Code at /Applications/Visual Studio Code - Insiders.app/Contents
    • Flutter extension can be installed from:
      🔨 https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter

[✓] Connected device (4 available)
    • Shady’s Shenanigans (mobile)                   • 00008110-001129523C09801E            • ios            • iOS 17.4.1 21E236
    • iPad Pro (12.9-inch) (6th generation) (mobile) • 71A2390D-33E0-40A6-965A-17475C5A5527 • ios            • com.apple.CoreSimulator.SimRuntime.iOS-17-2 (simulator)
    • macOS (desktop)                                • macos                                • darwin-x64     • macOS 14.4.1 23E224 darwin-x64
    • Chrome (web)                                   • chrome                               • web-javascript • Google Chrome 124.0.6367.91

[✓] Network resources
    • All expected network resources are available.

• No issues found!

@premiumbiscuit You are using flutter_bloc which is community package. In order to properly address the issue, please narrow down the code sample to minimal but complete and without community package implementation, that still triggers the reported exception.

Thanks @darshankawar for looking into this. I have replaced flutter_bloc with a StreamController, please see the code below. Ultimately, anything that causes re-rendering will produce the bug for some reason.
Code sample
import 'dart:async';

import 'package:flutter/material.dart';
import 'package:go_router/go_router.dart';

final GlobalKey<NavigatorState> _rootNavigatorKey =
    GlobalKey<NavigatorState>(debugLabel: 'root');
final GlobalKey<NavigatorState> _sectionANavigatorKey =
    GlobalKey<NavigatorState>(debugLabel: 'sectionANav');

class CounterStream {
  final _stateController = StreamController<int>.broadcast();

  int _counter = 0;

  Stream<int> get stateStream => _stateController.stream.asBroadcastStream();

  void increment() {
    _stateController.sink.add(++_counter);
  }

  void dispose() {
    _stateController.close();
  }
}

final CounterStream counterStream = CounterStream();

void main() {
  runApp(NestedTabNavigationExampleApp());
}

/// An example demonstrating how to use nested navigators
class NestedTabNavigationExampleApp extends StatelessWidget {
  /// Creates a NestedTabNavigationExampleApp
  NestedTabNavigationExampleApp({super.key});

  final GoRouter _router = GoRouter(
    navigatorKey: _rootNavigatorKey,
    initialLocation: '/a/details',
    routes: <RouteBase>[
      StatefulShellRoute.indexedStack(
        builder: (BuildContext context, GoRouterState state,
            StatefulNavigationShell navigationShell) {
          // Return the widget that implements the custom shell (in this case
          // using a BottomNavigationBar). The StatefulNavigationShell is passed
          // to be able access the state of the shell and to navigate to other
          // branches in a stateful way.
          return ScaffoldWithNavBar(navigationShell: navigationShell);
        },
        branches: <StatefulShellBranch>[
          // The route branch for the first tab of the bottom navigation bar.
          StatefulShellBranch(
            navigatorKey: _sectionANavigatorKey,
            routes: <RouteBase>[
              GoRoute(
                // The screen to display as the root in the first tab of the
                // bottom navigation bar.
                path: '/a',
                builder: (BuildContext context, GoRouterState state) =>
                    const RootScreen(label: 'A', detailsPath: '/a/details'),
                routes: <RouteBase>[
                  // The details screen to display stacked on navigator of the
                  // first tab. This will cover screen A but not the application
                  // shell (bottom navigation bar).
                  GoRoute(
                    path: 'details',
                    builder: (BuildContext context, GoRouterState state) =>
                        const DetailsScreen(label: 'A'),
                  ),
                ],
              ),
            ],
          ),
        ],
      ),
    ],
  );

  @override
  Widget build(BuildContext context) {
    return MaterialApp.router(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      routerConfig: _router,
    );
  }
}

/// Builds the "shell" for the app by building a Scaffold with a
/// BottomNavigationBar, where [child] is placed in the body of the Scaffold.
class ScaffoldWithNavBar extends StatefulWidget {
  /// Constructs an [ScaffoldWithNavBar].
  const ScaffoldWithNavBar({
    required this.navigationShell,
    Key? key,
  }) : super(key: key ?? const ValueKey<String>('ScaffoldWithNavBar'));

  /// The navigation shell and container for the branch Navigators.
  final StatefulNavigationShell navigationShell;

  @override
  State<ScaffoldWithNavBar> createState() => _ScaffoldWithNavBarState();
}

class _ScaffoldWithNavBarState extends State<ScaffoldWithNavBar> {
  late StreamSubscription<int> _stateSubscription;
  int _currentState = 0;

  @override
  void initState() {
    super.initState();
    _stateSubscription = counterStream.stateStream.listen((state) {
      setState(() {
        _currentState = state;
      });
    });
  }

  @override
  void dispose() {
    _stateSubscription.cancel();
    super.dispose();
  }

  @override
  Widget build(BuildContext context) {
    return LayoutBuilder(
      builder: (BuildContext context, BoxConstraints constraint) {
        double width = constraint.maxWidth;

        final Widget narrowContent = ConstrainedBox(
          constraints: BoxConstraints(
            minHeight: MediaQuery.of(context).size.height,
          ),
          child: widget.navigationShell,
        );

        late final Widget body;
        if (_currentState.isEven) {
          body = Stack(children: [
            Positioned.fill(child: narrowContent),
          ]);
        } else {
          body = Column(children: [Expanded(child: narrowContent)]);
        }

        final Widget rightArea = SafeArea(
          // key: const Key('right_area'),
          child: Align(
            alignment: Alignment.center,
            child: ConstrainedBox(
              constraints: const BoxConstraints(
                maxWidth: 800,
              ),
              child: body,
            ),
          ),
        );

        return Scaffold(
          body: rightArea,
          bottomNavigationBar: BottomNavigationBar(
            // Here, the items of BottomNavigationBar are hard coded. In a real
            // world scenario, the items would most likely be generated from the
            // branches of the shell route, which can be fetched using
            // `navigationShell.route.branches`.
            items: const <BottomNavigationBarItem>[
              BottomNavigationBarItem(
                  icon: Icon(Icons.home), label: 'Section A'),
              BottomNavigationBarItem(
                  icon: Icon(Icons.work), label: 'Section B'),
              BottomNavigationBarItem(
                  icon: Icon(Icons.tab), label: 'Section C'),
            ],
            currentIndex: widget.navigationShell.currentIndex,
            onTap: (int index) => _onTap(context, index),
          ),
        );
      },
    );
  }

  /// Navigate to the current location of the branch at the provided index when
  /// tapping an item in the BottomNavigationBar.
  void _onTap(BuildContext context, int index) {
    // When navigating to a new branch, it's recommended to use the goBranch
    // method, as doing so makes sure the last navigation state of the
    // Navigator for the branch is restored.
    widget.navigationShell.goBranch(
      index,
      // A common pattern when using bottom navigation bars is to support
      // navigating to the initial location when tapping the item that is
      // already active. This example demonstrates how to support this behavior,
      // using the initialLocation parameter of goBranch.
      initialLocation: index == widget.navigationShell.currentIndex,
    );
  }
}

/// Widget for the root/initial pages in the bottom navigation bar.
class RootScreen extends StatefulWidget {
  /// Creates a RootScreen
  const RootScreen({
    required this.label,
    required this.detailsPath,
    this.secondDetailsPath,
    super.key,
  });

  /// The label
  final String label;

  /// The path to the detail page
  final String detailsPath;

  /// The path to another detail page
  final String? secondDetailsPath;

  @override
  State<RootScreen> createState() => _RootScreenState();
}

class _RootScreenState extends State<RootScreen> {
  late StreamSubscription<int> _stateSubscription;
  int _currentState = 0;

  @override
  void initState() {
    super.initState();
    _stateSubscription = counterStream.stateStream.listen((state) {
      setState(() {
        _currentState = state;
      });
    });
  }

  @override
  void dispose() {
    _stateSubscription.cancel();
    super.dispose();
  }

  @override
  Widget build(BuildContext context) {
    if (_currentState.isEven) {
      return Scaffold(body: const CircularProgressIndicator());
    } else {
      return Text('Screen ${widget.label}',
          style: Theme.of(context).textTheme.titleLarge);
    }
  }
}

/// The details screen for either the A or B screen.
class DetailsScreen extends StatefulWidget {
  /// Constructs a [DetailsScreen].
  const DetailsScreen({
    required this.label,
    this.param,
    this.extra,
    this.withScaffold = true,
    super.key,
  });

  /// The label to display in the center of the screen.
  final String label;

  /// Optional param
  final String? param;

  /// Optional extra object
  final Object? extra;

  /// Wrap in scaffold
  final bool withScaffold;

  @override
  State<StatefulWidget> createState() => DetailsScreenState();
}

/// The state for DetailsScreen
class DetailsScreenState extends State<DetailsScreen> {
  late StreamSubscription<int> _stateSubscription;
  int _currentCount = 0;

  @override
  void initState() {
    super.initState();
    _stateSubscription = counterStream.stateStream.listen((state) {
      setState(() {
        _currentCount = state;
      });
    });
  }

  @override
  void dispose() {
    _stateSubscription.cancel();
    super.dispose();
  }

  @override
  Widget build(BuildContext context) {
    if (widget.withScaffold) {
      return Scaffold(
        appBar: AppBar(
          title: Text('Details Screen - ${widget.label}'),
        ),
        body: _build(context),
      );
    } else {
      return ColoredBox(
        color: Theme.of(context).scaffoldBackgroundColor,
        child: _build(context),
      );
    }
  }

  Widget _build(BuildContext context) {
    return Center(
      child: Column(
        mainAxisSize: MainAxisSize.min,
        children: <Widget>[
          Text('Details for ${widget.label} - Counter: ${_currentCount}',
              style: Theme.of(context).textTheme.titleLarge),
          const Padding(padding: EdgeInsets.all(4)),
          TextButton(
            onPressed: () {
              setState(() {
                counterStream.increment();
              });
            },
            child: const Text('Crash me!'),
          ),
          const Padding(padding: EdgeInsets.all(8)),
          if (widget.param != null)
            Text('Parameter: ${widget.param!}',
                style: Theme.of(context).textTheme.titleMedium),
          const Padding(padding: EdgeInsets.all(8)),
          if (widget.extra != null)
            Text('Extra: ${widget.extra!}',
                style: Theme.of(context).textTheme.titleMedium),
          if (!widget.withScaffold) ...<Widget>[
            const Padding(padding: EdgeInsets.all(16)),
            TextButton(
              onPressed: () {
                GoRouter.of(context).pop();
              },
              child: const Text('< Back',
                  style: TextStyle(fontWeight: FontWeight.bold, fontSize: 18)),
            ),
          ]
        ],
      ),
    );
  }
}

Thanks for the update. Using above code sample, it throws below error log in the console:

 error log

======== Exception caught by widgets library =======================================================
The following assertion was thrown building RootScreen(dependencies: [_InheritedTheme, _LocalizationsScope-[GlobalKey#ca008]], state: _RootScreenState#b7568):
'package:flutter/src/rendering/object.dart': Failed assertion: line 2283 pos 14: '_debugSubtreeRelayoutRootAlreadyMarkedNeedsLayout()': is not true.

Either the assertion indicates an error in the framework itself, or we should provide substantially more information in this error message to help you determine and fix the underlying cause.
In either case, please report this assertion by filing a bug on GitHub:
  https://github.com/flutter/flutter/issues/new?template=2_bug.yml

The relevant error-causing widget was:
  RootScreen RootScreen:file:///Users/dhs/Documents/NCFlutter/app_foo_stable/lib/main.dart:61:23
When the exception was thrown, this was the stack:
#2      RenderObject.markNeedsLayout (package:flutter/src/rendering/object.dart:2283:14)
#3      RenderBox.markNeedsLayout (package:flutter/src/rendering/box.dart:2379:11)
#4      RenderObject.dropChild (package:flutter/src/rendering/object.dart:1863:5)
#5      RenderObjectWithChildMixin.child= (package:flutter/src/rendering/object.dart:4051:7)
#6      SingleChildRenderObjectElement.removeRenderObjectChild (package:flutter/src/widgets/framework.dart:6787:18)
#7      RenderObjectElement.detachRenderObject (package:flutter/src/widgets/framework.dart:6601:37)
#8      Element.detachRenderObject.<anonymous closure> (package:flutter/src/widgets/framework.dart:4202:13)
#9      ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5532:14)
#10     Element.detachRenderObject (package:flutter/src/widgets/framework.dart:4201:5)
#11     Element.deactivateChild (package:flutter/src/widgets/framework.dart:4376:11)
#12     Element.updateChild (package:flutter/src/widgets/framework.dart:3835:9)
#13     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5505:16)
#14     StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:5643:11)
#15     Element.rebuild (package:flutter/src/widgets/framework.dart:5196:7)
#16     BuildOwner.buildScope (package:flutter/src/widgets/framework.dart:2904:19)
#17     WidgetsBinding.drawFrame (package:flutter/src/widgets/binding.dart:989:21)
#18     RendererBinding._handlePersistentFrameCallback (package:flutter/src/rendering/binding.dart:448:5)
#19     SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:1386:15)
#20     SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:1311:9)
#21     SchedulerBinding._handleDrawFrame (package:flutter/src/scheduler/binding.dart:1169:5)
#22     _invoke (dart:ui/hooks.dart:312:13)
#23     PlatformDispatcher._drawFrame (dart:ui/platform_dispatcher.dart:399:5)
#24     _drawFrame (dart:ui/hooks.dart:283:31)
(elided 2 frames from class _AssertionError)
====================================================================================================

======== Exception caught by widgets library =======================================================
The following assertion was thrown while rebuilding dirty elements:
'package:flutter/src/rendering/object.dart': Failed assertion: line 1853 pos 12: 'child._parent == this': is not true.

Either the assertion indicates an error in the framework itself, or we should provide substantially more information in this error message to help you determine and fix the underlying cause.
In either case, please report this assertion by filing a bug on GitHub:
  https://github.com/flutter/flutter/issues/new?template=2_bug.yml

The relevant error-causing widget was:
  RootScreen RootScreen:file:///Users/dhs/Documents/NCFlutter/app_foo_stable/lib/main.dart:61:23
When the exception was thrown, this was the stack:
#2      RenderObject.dropChild (package:flutter/src/rendering/object.dart:1853:12)
#3      RenderObjectWithChildMixin.child= (package:flutter/src/rendering/object.dart:4051:7)
#4      SingleChildRenderObjectElement.insertRenderObjectChild (package:flutter/src/widgets/framework.dart:6773:18)
#5      RenderObjectElement.attachRenderObject (package:flutter/src/widgets/framework.dart:6591:35)
#6      RenderObjectElement.mount (package:flutter/src/widgets/framework.dart:6458:5)
#7      Element.inflateWidget (package:flutter/src/widgets/framework.dart:4335:16)
#8      Element.updateChild (package:flutter/src/widgets/framework.dart:3846:18)
#9      ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5519:16)
#10     StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:5643:11)
#11     Element.rebuild (package:flutter/src/widgets/framework.dart:5196:7)
#12     BuildOwner.buildScope (package:flutter/src/widgets/framework.dart:2904:19)
#13     WidgetsBinding.drawFrame (package:flutter/src/widgets/binding.dart:989:21)
#14     RendererBinding._handlePersistentFrameCallback (package:flutter/src/rendering/binding.dart:448:5)
#15     SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:1386:15)
#16     SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:1311:9)
#17     SchedulerBinding._handleDrawFrame (package:flutter/src/scheduler/binding.dart:1169:5)
#18     _invoke (dart:ui/hooks.dart:312:13)
#19     PlatformDispatcher._drawFrame (dart:ui/platform_dispatcher.dart:399:5)
#20     _drawFrame (dart:ui/hooks.dart:283:31)
(elided 2 frames from class _AssertionError)
The element being rebuilt at the time was index 2 of 5: RootScreen
  dependencies: [_InheritedTheme, _LocalizationsScope-[GlobalKey#ca008]]
  state: _RootScreenState#b7568
====================================================================================================

======== Exception caught by widgets library =======================================================
The following assertion was thrown building MediaQuery(MediaQueryData(size: Size(411.4, 707.4), devicePixelRatio: 3.5, textScaler: no scaling, platformBrightness: Brightness.light, padding: EdgeInsets.zero, viewPadding: EdgeInsets.zero, viewInsets: EdgeInsets.zero, systemGestureInsets: EdgeInsets(30.0, 24.0, 30.0, 8.0), alwaysUse24HourFormat: false, accessibleNavigation: false, highContrast: false, onOffSwitchLabels: false, disableAnimations: false, invertColors: false, boldText: false, navigationMode: traditional, gestureSettings: DeviceGestureSettings(touchSlop: 8.0), displayFeatures: [])):
'package:flutter/src/rendering/object.dart': Failed assertion: line 2164 pos 12: '_owner != null': is not true.

Either the assertion indicates an error in the framework itself, or we should provide substantially more information in this error message to help you determine and fix the underlying cause.

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:
  SafeArea SafeArea:file:///Users/dhs/Documents/NCFlutter/app_foo_stable/lib/main.dart:150:34
When the exception was thrown, this was the stack:
#2      RenderObject.detach (package:flutter/src/rendering/object.dart:2164:12)
#3      ContainerRenderObjectMixin.detach (package:flutter/src/rendering/object.dart:4349:11)
#4      RenderObjectWithChildMixin.detach (package:flutter/src/rendering/object.dart:4068:13)
#5      RenderObjectWithChildMixin.detach (package:flutter/src/rendering/object.dart:4068:13)
#6      RenderObject.dropChild (package:flutter/src/rendering/object.dart:1861:13)
#7      RenderObjectWithChildMixin.child= (package:flutter/src/rendering/object.dart:4051:7)
#8      SingleChildRenderObjectElement.insertRenderObjectChild (package:flutter/src/widgets/framework.dart:6773:18)
#9      RenderObjectElement.attachRenderObject (package:flutter/src/widgets/framework.dart:6591:35)
#10     RenderObjectElement.mount (package:flutter/src/widgets/framework.dart:6458:5)
#11     Element.inflateWidget (package:flutter/src/widgets/framework.dart:4335:16)
#12     Element.updateChild (package:flutter/src/widgets/framework.dart:3846:18)
#13     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5519:16)
#14     Element.rebuild (package:flutter/src/widgets/framework.dart:5196:7)
#15     ProxyElement.update (package:flutter/src/widgets/framework.dart:5809:5)
#16     Element.updateChild (package:flutter/src/widgets/framework.dart:3824:15)
#17     SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:6765:14)
#18     Element.updateChild (package:flutter/src/widgets/framework.dart:3824:15)
#19     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5505:16)
#20     Element.rebuild (package:flutter/src/widgets/framework.dart:5196:7)
#21     StatelessElement.update (package:flutter/src/widgets/framework.dart:5556:5)
#22     Element.updateChild (package:flutter/src/widgets/framework.dart:3824:15)
#23     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5505:16)
#24     Element.rebuild (package:flutter/src/widgets/framework.dart:5196:7)
#25     StatelessElement.update (package:flutter/src/widgets/framework.dart:5556:5)
#26     Element.updateChild (package:flutter/src/widgets/framework.dart:3824:15)
#27     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5505:16)
#28     Element.rebuild (package:flutter/src/widgets/framework.dart:5196:7)
#29     StatelessElement.update (package:flutter/src/widgets/framework.dart:5556:5)
#30     Element.updateChild (package:flutter/src/widgets/framework.dart:3824:15)
#31     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5505:16)
#32     Element.rebuild (package:flutter/src/widgets/framework.dart:5196:7)
#33     ProxyElement.update (package:flutter/src/widgets/framework.dart:5809:5)
#34     Element.updateChild (package:flutter/src/widgets/framework.dart:3824:15)
#35     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5505:16)
#36     Element.rebuild (package:flutter/src/widgets/framework.dart:5196:7)
#37     ProxyElement.update (package:flutter/src/widgets/framework.dart:5809:5)
#38     Element.updateChild (package:flutter/src/widgets/framework.dart:3824:15)
#39     Element.updateChildren (package:flutter/src/widgets/framework.dart:3973:32)
#40     MultiChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:6918:17)
#41     Element.updateChild (package:flutter/src/widgets/framework.dart:3824:15)
#42     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5505:16)
#43     Element.rebuild (package:flutter/src/widgets/framework.dart:5196:7)
#44     ProxyElement.update (package:flutter/src/widgets/framework.dart:5809:5)
#45     Element.updateChild (package:flutter/src/widgets/framework.dart:3824:15)
#46     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5505:16)
#47     StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:5643:11)
#48     Element.rebuild (package:flutter/src/widgets/framework.dart:5196:7)
#49     StatefulElement.update (package:flutter/src/widgets/framework.dart:5666:5)
#50     Element.updateChild (package:flutter/src/widgets/framework.dart:3824:15)
#51     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5505:16)
#52     StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:5643:11)
#53     Element.rebuild (package:flutter/src/widgets/framework.dart:5196:7)
#54     StatefulElement.update (package:flutter/src/widgets/framework.dart:5666:5)
#55     Element.updateChild (package:flutter/src/widgets/framework.dart:3824:15)
#56     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5505:16)
#57     Element.rebuild (package:flutter/src/widgets/framework.dart:5196:7)
#58     ProxyElement.update (package:flutter/src/widgets/framework.dart:5809:5)
#59     Element.updateChild (package:flutter/src/widgets/framework.dart:3824:15)
#60     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5505:16)
#61     StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:5643:11)
#62     Element.rebuild (package:flutter/src/widgets/framework.dart:5196:7)
#63     StatefulElement.update (package:flutter/src/widgets/framework.dart:5666:5)
#64     Element.updateChild (package:flutter/src/widgets/framework.dart:3824:15)
#65     SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:6765:14)
#66     Element.updateChild (package:flutter/src/widgets/framework.dart:3824:15)
#67     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5505:16)
#68     Element.rebuild (package:flutter/src/widgets/framework.dart:5196:7)
#69     ProxyElement.update (package:flutter/src/widgets/framework.dart:5809:5)
#70     Element.updateChild (package:flutter/src/widgets/framework.dart:3824:15)
#71     SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:6765:14)
#72     Element.updateChild (package:flutter/src/widgets/framework.dart:3824:15)
#73     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5505:16)
#74     StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:5643:11)
#75     Element.rebuild (package:flutter/src/widgets/framework.dart:5196:7)
#76     StatefulElement.update (package:flutter/src/widgets/framework.dart:5666:5)
#77     Element.updateChild (package:flutter/src/widgets/framework.dart:3824:15)
#78     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5505:16)
#79     StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:5643:11)
#80     Element.rebuild (package:flutter/src/widgets/framework.dart:5196:7)
#81     StatefulElement.update (package:flutter/src/widgets/framework.dart:5666:5)
#82     Element.updateChild (package:flutter/src/widgets/framework.dart:3824:15)
#83     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5505:16)
#84     Element.rebuild (package:flutter/src/widgets/framework.dart:5196:7)
#85     ProxyElement.update (package:flutter/src/widgets/framework.dart:5809:5)
#86     Element.updateChild (package:flutter/src/widgets/framework.dart:3824:15)
#87     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5505:16)
#88     Element.rebuild (package:flutter/src/widgets/framework.dart:5196:7)
#89     ProxyElement.update (package:flutter/src/widgets/framework.dart:5809:5)
#90     Element.updateChild (package:flutter/src/widgets/framework.dart:3824:15)
#91     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5505:16)
#92     Element.rebuild (package:flutter/src/widgets/framework.dart:5196:7)
#93     ProxyElement.update (package:flutter/src/widgets/framework.dart:5809:5)
#94     Element.updateChild (package:flutter/src/widgets/framework.dart:3824:15)
#95     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5505:16)
#96     StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:5643:11)
#97     Element.rebuild (package:flutter/src/widgets/framework.dart:5196:7)
#98     StatefulElement.update (package:flutter/src/widgets/framework.dart:5666:5)
#99     Element.updateChild (package:flutter/src/widgets/framework.dart:3824:15)
#100    ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5505:16)
#101    Element.rebuild (package:flutter/src/widgets/framework.dart:5196:7)
#102    ProxyElement.update (package:flutter/src/widgets/framework.dart:5809:5)
#103    Element.updateChild (package:flutter/src/widgets/framework.dart:3824:15)
#104    ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5505:16)
#105    StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:5643:11)
#106    Element.rebuild (package:flutter/src/widgets/framework.dart:5196:7)
#107    StatefulElement.update (package:flutter/src/widgets/framework.dart:5666:5)
#108    Element.updateChild (package:flutter/src/widgets/framework.dart:3824:15)
#109    _LayoutBuilderElement._layout.layoutCallback (package:flutter/src/widgets/layout_builder.dart:155:18)
#110    BuildOwner.buildScope (package:flutter/src/widgets/framework.dart:2844:19)
#111    _LayoutBuilderElement._layout (package:flutter/src/widgets/layout_builder.dart:173:12)
#112    RenderObject.invokeLayoutCallback.<anonymous closure> (package:flutter/src/rendering/object.dart:2686:59)
#113    PipelineOwner._enableMutationsToDirtySubtrees (package:flutter/src/rendering/object.dart:1097:15)
#114    RenderObject.invokeLayoutCallback (package:flutter/src/rendering/object.dart:2686:14)
#115    RenderConstrainedLayoutBuilder.rebuildIfNecessary (package:flutter/src/widgets/layout_builder.dart:248:7)
#116    _RenderLayoutBuilder.performLayout (package:flutter/src/widgets/layout_builder.dart:331:5)
#117    RenderObject._layoutWithoutResize (package:flutter/src/rendering/object.dart:2414:7)
#118    PipelineOwner.flushLayout (package:flutter/src/rendering/object.dart:1051:18)
#119    PipelineOwner.flushLayout (package:flutter/src/rendering/object.dart:1064:15)
#120    RendererBinding.drawFrame (package:flutter/src/rendering/binding.dart:582:23)
#121    WidgetsBinding.drawFrame (package:flutter/src/widgets/binding.dart:991:13)
#122    RendererBinding._handlePersistentFrameCallback (package:flutter/src/rendering/binding.dart:448:5)
#123    SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:1386:15)
#124    SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:1311:9)
#125    SchedulerBinding._handleDrawFrame (package:flutter/src/scheduler/binding.dart:1169:5)
#126    _invoke (dart:ui/hooks.dart:312:13)
#127    PlatformDispatcher._drawFrame (dart:ui/platform_dispatcher.dart:399:5)
#128    _drawFrame (dart:ui/hooks.dart:283:31)
(elided 2 frames from class _AssertionError)
====================================================================================================

======== Exception caught by rendering library =====================================================
The following assertion was thrown during performLayout():
Each child must be laid out exactly once.

 Flutter (Channel stable, 3.19.6, on macOS 12.2.1 21D62 darwin-x64, locale
    en-GB)
    • Flutter version 3.19.6 on channel stable at
      /Users/dhs/documents/fluttersdk/flutter
    ! Warning: `flutter` on your path resolves to
      /Users/dhs/Documents/Fluttersdk/flutter/bin/flutter, which is not inside
      your current Flutter SDK checkout at
      /Users/dhs/documents/fluttersdk/flutter. Consider adding
      /Users/dhs/documents/fluttersdk/flutter/bin to the front of your path.
    ! Warning: `dart` on your path resolves to
      /Users/dhs/Documents/Fluttersdk/flutter/bin/dart, which is not inside your
      current Flutter SDK checkout at /Users/dhs/documents/fluttersdk/flutter.
      Consider adding /Users/dhs/documents/fluttersdk/flutter/bin to the front
      of your path.
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 54e66469a9 (6 days ago), 2024-04-17 13:08:03 -0700
    • Engine revision c4cd48e186
    • Dart version 3.3.4
    • DevTools version 2.31.1
    • If those were intentional, you can disregard the above warnings; however
      it is recommended to use "git" directly to perform update checks and
      upgrades.

[!] Xcode - develop for iOS and macOS (Xcode 12.3)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    ! Flutter recommends a minimum Xcode version of 13.
      Download the latest version or update via the Mac App Store.
    • CocoaPods version 1.11.2

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] VS Code (version 1.62.0)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.21.0

[✓] Connected device (5 available)
    • SM G975F (mobile)       • RZ8M802WY0X • android-arm64   • Android 11 (API 30)
    • Darshan's iphone (mobile)  • 21150b119064aecc249dfcfe05e259197461ce23 •
      ios            • iOS 14.4.1 18D61
    • iPhone 12 Pro Max (mobile) • A5473606-0213-4FD8-BA16-553433949729     •
      ios            • com.apple.CoreSimulator.SimRuntime.iOS-14-3 (simulator)
    • macOS (desktop)            • macos                                    •
      darwin-x64     • Mac OS X 10.15.4 19E2269 darwin-x64
    • Chrome (web)               • chrome                                   •
      web-javascript • Google Chrome 98.0.4758.80

[✓] HTTP Host Availability
    • All required HTTP hosts are available

! Doctor found issues in 1 category.

[!] Flutter (Channel master, 3.22.0-23.0.pre.43, on macOS 12.2.1 21D62
    darwin-x64, locale en-GB)
    • Flutter version 3.22.0-23.0.pre.43 on channel master at
      /Users/dhs/documents/fluttersdk/flutter
    ! Warning: `flutter` on your path resolves to
      /Users/dhs/Documents/Fluttersdk/flutter/bin/flutter, which is not inside
      your current Flutter SDK checkout at
      /Users/dhs/documents/fluttersdk/flutter. Consider adding
      /Users/dhs/documents/fluttersdk/flutter/bin to the front of your path.
    ! Warning: `dart` on your path resolves to
      /Users/dhs/Documents/Fluttersdk/flutter/bin/dart, which is not inside your
      current Flutter SDK checkout at /Users/dhs/documents/fluttersdk/flutter.
      Consider adding /Users/dhs/documents/fluttersdk/flutter/bin to the front
      of your path.
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision b8abc10689 (12 hours ago), 2024-05-05 13:01:23 -0400
    • Engine revision 624dcb987f
    • Dart version 3.5.0 (build 3.5.0-131.0.dev)
    • DevTools version 2.35.0
    • If those were intentional, you can disregard the above warnings; however
      it is recommended to use "git" directly to perform update checks and
      upgrades.

[!] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
    • Android SDK at /Users/dhs/Library/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/macos#android-setup for
      more details.

[✓] Xcode - develop for iOS and macOS (Xcode 13.2.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 13C100
    • CocoaPods version 1.11.2

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] IntelliJ IDEA Ultimate Edition (version 2021.3.2)
    • IntelliJ at /Applications/IntelliJ IDEA.app
    • Flutter plugin version 65.1.4
    • Dart plugin version 213.7228

[✓] VS Code (version 1.62.0)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.29.0

[✓] Connected device (3 available)
    • Darshan's iphone (mobile) • 21150b119064aecc249dfcfe05e259197461ce23 • ios
      • iOS 15.3.1 19D52
    • macOS (desktop)           • macos                                    •
      darwin-x64     • macOS 12.2.1 21D62 darwin-x64
    • Chrome (web)              • chrome                                   •
      web-javascript • Google Chrome 109.0.5414.119

[✓] Network resources
    • All expected network resources are available.

! Doctor found issues in 1 category.

[!] Xcode - develop for iOS and macOS (Xcode 12.3)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    ! Flutter recommends a minimum Xcode version of 13.
      Download the latest version or update via the Mac App Store.
    • CocoaPods version 1.11.2

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] VS Code (version 1.62.0)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.21.0

[✓] Connected device (5 available)
    • SM G975F (mobile)       • RZ8M802WY0X • android-arm64   • Android 11 (API 30)
    • Darshan's iphone (mobile)  • 21150b119064aecc249dfcfe05e259197461ce23 •
      ios            • iOS 14.4.1 18D61
    • iPhone 12 Pro Max (mobile) • A5473606-0213-4FD8-BA16-553433949729     •
      ios            • com.apple.CoreSimulator.SimRuntime.iOS-14-3 (simulator)
    • macOS (desktop)            • macos                                    •
      darwin-x64     • Mac OS X 10.15.4 19E2269 darwin-x64
    • Chrome (web)               • chrome                                   •
      web-javascript • Google Chrome 98.0.4758.80

[✓] HTTP Host Availability
    • All required HTTP hosts are available

! Doctor found issues in 1 category.

Thank you for the report. To debug this it would help if you could reduce the test case more, see https://github.com/flutter/flutter/wiki/Issue-hygiene#provide-reduced-test-cases

I tried to come up with reduced repro code as below without go_router implementation but it is giving me different error, so probably @premiumbiscuit please try to narrow down the code to bare minimum that still triggers the reported error.

I'm also having this issue with go router's StatefulShellRoute which makes it unusable.
Recreation steps

Setup a statefull hirachy like this:
/a
/b
/b/details

Create a LayoutBuilder on page B (we wont visit this page, but it'll trigger the bug)

Navigate to page /b/details?t=1

Navigate back to /a

Navigate to /b/details?t=2 for the second time (CRASH in /b's layout builder*)

It seems like page /b is flagged for a re-layout, but this never happens (due to go router having it hidden), when the widget rebuilds it tries to remark the widget as needing layout and causes the error.
Logs

flutter doctor
PS C:\Users\x\source\repos\flutter_bug\flutter_bug> flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 3.19.0, on Microsoft Windows [Version 10.0.22631.3593], locale en-GB)
[√] 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.5)
[√] Android Studio (version 2022.2)
[√] VS Code (version 1.89.1)
[√] Connected device (4 available)
[√] Network resources

• No issues found!

Stack Trace
Launching lib\main.dart on Windows in debug mode...
√  Built build\windows\x64\runner\Debug\flutter_bug.exe.
Connecting to VM Service at ws://<IP_ADDRESS>:62751/1Q5oMe9JLFo=/ws

════════ Exception caught by widgets library ═══════════════════════════════════
The following assertion was thrown building Builder:
'package:flutter/src/rendering/object.dart': Failed assertion: line 2283 pos 14: '_debugSubtreeRelayoutRootAlreadyMarkedNeedsLayout()': is not true.

Either the assertion indicates an error in the framework itself, or we should provide substantially more information in this error message to help you determine and fix the underlying cause.
In either case, please report this assertion by filing a bug on GitHub:
  https://github.com/flutter/flutter/issues/new?template=2_bug.yml

The relevant error-causing widget was:
    Scaffold Scaffold:file:///C:/Users/Jack/source/repos/flutter_bug/flutter_bug/lib/main.dart:71:12

When the exception was thrown, this was the stack:
#2      RenderObject.markNeedsLayout (package:flutter/src/rendering/object.dart:2283:14)
#3      RenderBox.markNeedsLayout (package:flutter/src/rendering/box.dart:2379:11)
#4      RenderConstrainedLayoutBuilder.markNeedsBuild (package:flutter/src/widgets/layout_builder.dart:231:5)
#5      _LayoutBuilderElement.update (package:flutter/src/widgets/layout_builder.dart:112:20)
#6      Element.updateChild (package:flutter/src/widgets/framework.dart:3824:15)
#7      ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5505:16)
#8      Element.rebuild (package:flutter/src/widgets/framework.dart:5196:7)
#9      StatelessElement.update (package:flutter/src/widgets/framework.dart:5556:5)
#10     Element.updateChild (package:flutter/src/widgets/framework.dart:3824:15)
#11     SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:6765:14)
#12     Element.updateChild (package:flutter/src/widgets/framework.dart:3824:15)
#13     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5505:16)
#14     Element.rebuild (package:flutter/src/widgets/framework.dart:5196:7)
#15     StatelessElement.update (package:flutter/src/widgets/framework.dart:5556:5)
#16     Element.updateChild (package:flutter/src/widgets/framework.dart:3824:15)
#17     SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:6765:14)
#18     Element.updateChild (package:flutter/src/widgets/framework.dart:3824:15)
#19     SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:6765:14)
#20     Element.updateChild (package:flutter/src/widgets/framework.dart:3824:15)
#21     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5505:16)
#22     StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:5643:11)
#23     Element.rebuild (package:flutter/src/widgets/framework.dart:5196:7)
#24     StatefulElement.update (package:flutter/src/widgets/framework.dart:5666:5)
#25     Element.updateChild (package:flutter/src/widgets/framework.dart:3824:15)
#26     SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:6765:14)
#27     Element.updateChild (package:flutter/src/widgets/framework.dart:3824:15)
#28     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5505:16)
#29     StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:5643:11)
#30     Element.rebuild (package:flutter/src/widgets/framework.dart:5196:7)
#31     StatefulElement.update (package:flutter/src/widgets/framework.dart:5666:5)
#32     Element.updateChild (package:flutter/src/widgets/framework.dart:3824:15)
#33     SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:6765:14)
#34     Element.updateChild (package:flutter/src/widgets/framework.dart:3824:15)
#35     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5505:16)
#36     StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:5643:11)
#37     Element.rebuild (package:flutter/src/widgets/framework.dart:5196:7)
#38     StatefulElement.update (package:flutter/src/widgets/framework.dart:5666:5)
#39     Element.updateChild (package:flutter/src/widgets/framework.dart:3824:15)
#40     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5505:16)
#41     StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:5643:11)
#42     Element.rebuild (package:flutter/src/widgets/framework.dart:5196:7)
#43     StatefulElement.update (package:flutter/src/widgets/framework.dart:5666:5)
#44     Element.updateChild (package:flutter/src/widgets/framework.dart:3824:15)
#45     SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:6765:14)
#46     Element.updateChild (package:flutter/src/widgets/framework.dart:3824:15)
#47     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5505:16)
#48     StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:5643:11)
#49     Element.rebuild (package:flutter/src/widgets/framework.dart:5196:7)
#50     StatefulElement.update (package:flutter/src/widgets/framework.dart:5666:5)
#51     Element.updateChild (package:flutter/src/widgets/framework.dart:3824:15)
#52     SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:6765:14)
#53     Element.updateChild (package:flutter/src/widgets/framework.dart:3824:15)
#54     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5505:16)
#55     StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:5643:11)
#56     Element.rebuild (package:flutter/src/widgets/framework.dart:5196:7)
#57     StatefulElement.update (package:flutter/src/widgets/framework.dart:5666:5)
#58     Element.updateChild (package:flutter/src/widgets/framework.dart:3824:15)
#59     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5505:16)
#60     StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:5643:11)
#61     Element.rebuild (package:flutter/src/widgets/framework.dart:5196:7)
#62     StatefulElement.update (package:flutter/src/widgets/framework.dart:5666:5)
#63     Element.updateChild (package:flutter/src/widgets/framework.dart:3824:15)
#64     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5505:16)
#65     Element.rebuild (package:flutter/src/widgets/framework.dart:5196:7)
#66     StatelessElement.update (package:flutter/src/widgets/framework.dart:5556:5)
#67     Element.updateChild (package:flutter/src/widgets/framework.dart:3824:15)
#68     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5505:16)
#69     StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:5643:11)
#70     Element.rebuild (package:flutter/src/widgets/framework.dart:5196:7)
#71     StatefulElement.update (package:flutter/src/widgets/framework.dart:5666:5)
#72     Element.updateChild (package:flutter/src/widgets/framework.dart:3824:15)
#73     SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:6765:14)
#74     Element.updateChild (package:flutter/src/widgets/framework.dart:3824:15)
#75     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5505:16)
#76     Element.rebuild (package:flutter/src/widgets/framework.dart:5196:7)
#77     ProxyElement.update (package:flutter/src/widgets/framework.dart:5809:5)
#78     _InheritedNotifierElement.update (package:flutter/src/widgets/inherited_notifier.dart:105:11)
#79     Element.updateChild (package:flutter/src/widgets/framework.dart:3824:15)
#80     SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:6765:14)
#81     Element.updateChild (package:flutter/src/widgets/framework.dart:3824:15)
#82     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5505:16)
#83     StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:5643:11)
#84     Element.rebuild (package:flutter/src/widgets/framework.dart:5196:7)
#85     StatefulElement.update (package:flutter/src/widgets/framework.dart:5666:5)
#86     Element.updateChild (package:flutter/src/widgets/framework.dart:3824:15)
#87     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5505:16)
#88     Element.rebuild (package:flutter/src/widgets/framework.dart:5196:7)
#89     ProxyElement.update (package:flutter/src/widgets/framework.dart:5809:5)
#90     Element.updateChild (package:flutter/src/widgets/framework.dart:3824:15)
#91     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5505:16)
#92     Element.rebuild (package:flutter/src/widgets/framework.dart:5196:7)
#93     ProxyElement.update (package:flutter/src/widgets/framework.dart:5809:5)
#94     Element.updateChild (package:flutter/src/widgets/framework.dart:3824:15)
#95     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5505:16)
#96     StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:5643:11)
#97     Element.rebuild (package:flutter/src/widgets/framework.dart:5196:7)
#98     StatefulElement.update (package:flutter/src/widgets/framework.dart:5666:5)
#99     Element.updateChild (package:flutter/src/widgets/framework.dart:3824:15)
#100    ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5505:16)
#101    Element.rebuild (package:flutter/src/widgets/framework.dart:5196:7)
#102    StatelessElement.update (package:flutter/src/widgets/framework.dart:5556:5)
#103    Element.updateChild (package:flutter/src/widgets/framework.dart:3824:15)
#104    ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5505:16)
#105    Element.rebuild (package:flutter/src/widgets/framework.dart:5196:7)
#106    StatelessElement.update (package:flutter/src/widgets/framework.dart:5556:5)
#107    Element.updateChild (package:flutter/src/widgets/framework.dart:3824:15)
#108    SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:6765:14)
#109    Element.updateChild (package:flutter/src/widgets/framework.dart:3824:15)
#110    ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5505:16)
#111    Element.rebuild (package:flutter/src/widgets/framework.dart:5196:7)
#112    ProxyElement.update (package:flutter/src/widgets/framework.dart:5809:5)
#113    Element.updateChild (package:flutter/src/widgets/framework.dart:3824:15)
#114    ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5505:16)
#115    Element.rebuild (package:flutter/src/widgets/framework.dart:5196:7)
#116    ProxyElement.update (package:flutter/src/widgets/framework.dart:5809:5)
#117    Element.updateChild (package:flutter/src/widgets/framework.dart:3824:15)
#118    ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5505:16)
#119    StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:5643:11)
#120    Element.rebuild (package:flutter/src/widgets/framework.dart:5196:7)
#121    StatefulElement.update (package:flutter/src/widgets/framework.dart:5666:5)
#122    Element.updateChild (package:flutter/src/widgets/framework.dart:3824:15)
#123    ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5505:16)
#124    StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:5643:11)
#125    Element.rebuild (package:flutter/src/widgets/framework.dart:5196:7)
#126    StatefulElement.update (package:flutter/src/widgets/framework.dart:5666:5)
#127    Element.updateChild (package:flutter/src/widgets/framework.dart:3824:15)
#128    ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5505:16)
#129    StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:5643:11)
#130    Element.rebuild (package:flutter/src/widgets/framework.dart:5196:7)
#131    BuildOwner.buildScope (package:flutter/src/widgets/framework.dart:2904:19)
#132    WidgetsBinding.drawFrame (package:flutter/src/widgets/binding.dart:989:21)
#133    RendererBinding._handlePersistentFrameCallback (package:flutter/src/rendering/binding.dart:448:5)
#134    SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:1386:15)
#135    SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:1311:9)
#136    SchedulerBinding._handleDrawFrame (package:flutter/src/scheduler/binding.dart:1169:5)
#137    _invoke (dart:ui/hooks.dart:312:13)
#138    PlatformDispatcher._drawFrame (dart:ui/platform_dispatcher.dart:399:5)
#139    _drawFrame (dart:ui/hooks.dart:283:31)
(elided 2 frames from class _AssertionError)
════════════════════════════════════════════════════════════════════════════════

Sample code
Run and click the button 3 times
import 'package:flutter/material.dart';
import 'package:go_router/go_router.dart';

void main() {
  runApp(MainApp());
}

class MainApp extends StatelessWidget {
  MainApp({super.key});

  final _aBranch = GlobalKey<NavigatorState>(debugLabel: 'a');
  final _bBranch = GlobalKey<NavigatorState>(debugLabel: 'b');
  late GoRouter router = GoRouter(initialLocation: '/a', routes: <RouteBase>[
    StatefulShellRoute.indexedStack(
        builder: (context, state, navigationShell) => Shell(navigationShell: navigationShell),
        branches: <StatefulShellBranch>[
          StatefulShellBranch(navigatorKey: _aBranch, routes: [
            GoRoute(
              path: '/a',
              name: 'a',
              builder: (context, state) => Center(
                  child: Column(
                children: [
                  const Text('Page /a'),
                  ElevatedButton(
                      onPressed: () => context.go(
                          Uri(path: '/b/details', queryParameters: {'qs': DateTime.now().toIso8601String()})
                              .toString()),
                      child: const Text('Go To /b/details (again)')),
                ],
              )),
            )
          ]),
          StatefulShellBranch(navigatorKey: _bBranch, routes: [
            GoRoute(
                path: '/b',
                name: 'b',
                builder: (context, state) => LayoutBuilder(
                    builder: (context, constraints) => Container(
                          width: 100,
                          child: const Text("Page /b (this is never visted but rendered and causes a layout error)"),
                        )),
                routes: [
                  GoRoute(
                    path: 'details',
                    name: '/b/details',
                    builder: (context, state) => Column(children: [
                      const Text('Page /b/details'),
                      ElevatedButton(onPressed: () => context.go('/a'), child: Text('Go back to /a')),
                    ]),
                  ),
                ])
          ]),
        ])
  ]);
  @override
  Widget build(BuildContext context) {
    return MaterialApp.router(
      title: 'Crash State error',
      routerConfig: router,
    );
  }
}

class Shell extends StatelessWidget {
  final StatefulNavigationShell navigationShell;
  const Shell({super.key, required this.navigationShell});
  @override
  Widget build(BuildContext context) {
    return Scaffold(body: navigationShell);
  }
}

The code provided by @xortuna is exactly my issue. Combination of StatefulShellRoute and LayoutBuilder in the Shell page causes the exception.
Moving to a ShellRoute doesn't seem to produce the issue but is far from my ideal in my case

Also having the same issue. Works fine in release mode.
for me it was like this
/a
/b
/ba
if I am in /ba, and I reload the webapp, I will again be in /ba, and if I go back to /b there is no issue.
But if I go to /a from /ba, then I'll get this same error.
I won't get this issue if I don't reload the app and simple use it or if the app is in release mode

@saadzarif  - I have temporarily switched over to ShellRoute instead of StatefulShellRoute, which doesn't suffer from the same problem. It's less than ideal but does the job until the issue is resolved.

I have the same problem as well.

Adding the following code causes the same error message but only on android devices.
ThemeData(
  pageTransitionsTheme: const PageTransitionsTheme(
    builders: {
      TargetPlatform.android: OpenUpwardsPageTransitionsBuilder(),
      TargetPlatform.iOS: CupertinoPageTransitionsBuilder(),
      TargetPlatform.fuchsia: OpenUpwardsPageTransitionsBuilder(),
    },
  ),
),

Any updates ?

Seems like many packages adopted into flutter get abandoned.
It’s shocking that this issue is unaddressed despite being the de-facto standard in creating tabbed iOS apps.
If a widget is off stage it should not care if it’s asked to relayout multiple times, raising an assertion in this state does not make sense.
For now I’ve mostly avoided using layout builder and rewrote widgets in house that use it. The issue does not appear in release mode, but that’s simply due to the fact there’s no debugger raising the assertion.

I get a similar error (tried on web) with the following example (on the current master 3.27.x):
import 'package:flutter/material.dart';
import 'package:go_router/go_router.dart';

void main() => runApp(const MyApp());

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    final router = GoRouter(
      // Default to the nested location
      // Or for a more realistic use-case, navigate to the url /root/sub on the web
      initialLocation: '/root/sub',
      routes: [
        StatefulShellRoute.indexedStack(
            builder: (context, state, navigationShell) {
              // return Scaffold(body: const ListTile(title: Text('someText'))); // Does work
              return Scaffold(body: navigationShell); // Does not work
            },
            branches: [
              StatefulShellBranch(routes: [
                GoRoute(
                  path: '/root',
                  builder: (_, __) {
                    return const ListTile(
                      title: Text('rootA'),
                    );
                  },
                  routes: [
                    // Must be nested, so layouts are stacked on top
                    GoRoute(
                      path: 'sub',
                      builder: (_, __) {
                        return const ListTile(
                          title: Text('subA'),
                        );
                      },
                    ),
                  ],
                ),
              ]),
            ]),
      ],
    );
    return MaterialApp.router(
      routerConfig: router,
    );
  }
}

Logs
```
Synthetic package output (package:flutter_gen) is deprecated: https://flutter.dev/to/flutter-gen-deprecation. In a future release, synthetic-package will default to `false` and will later be removed entirely.
Launching lib/stateful_shell_route_list_tile_example.dart on Chrome in debug mode...
Waiting for connection from debug service on Chrome...
 Flutter (Channel master, 3.27.0-1.0.pre.446, on macOS 15.0.1 24A348 darwin-arm64, locale en-US)
! Warning: flutter on your path resolves to /opt/homebrew/Caskroom/flutter/3.22.2/flutter/bin/flutter, which is not inside your current Flutter SDK checkout at /Users/swi-oberhauser/Documents/git/flutter/flutter. Consider adding /Users/swi-oberhauser/Documents/git/flutter/flutter/bin to the front of
your path.
! Warning: dart on your path resolves to /opt/homebrew/Caskroom/flutter/3.22.2/flutter/bin/dart, which is not inside your current Flutter SDK checkout at /Users/swi-oberhauser/Documents/git/flutter/flutter. Consider adding /Users/swi-oberhauser/Documents/git/flutter/flutter/bin to the front of your
path.
[✓] Android toolchain - develop for Android devices (Android SDK version 35.0.0)
[!] Xcode - develop for iOS and macOS (Xcode 16.0)
! CocoaPods 1.15.2 out of date (1.16.2 is recommended).
CocoaPods is a package manager for iOS or macOS platform code.
Without CocoaPods, plugins will not work on iOS or macOS.
For more info, see https://flutter.dev/to/platform-plugins
To update CocoaPods, see https://guides.cocoapods.org/using/getting-started.html#updating-cocoapods
[✓] Chrome - develop for the web
[!] Android Studio (not installed)
[✓] IntelliJ IDEA Ultimate Edition (version 2024.2.3)
[✓] IntelliJ IDEA Community Edition (version 2024.2.3)
[✓] Connected device (3 available)
[✓] Network resources
! Doctor found issues in 3 categories.

</details>

Is there a workaround for this problem?

@orkun1675 you can return an empty Container, if the current route is NOT the top route in the StatefulShellRoute.builder. So underlaying widgets are not in the widget tree, which then won't render without layout phase.

@orkun1675 you can return an empty Container, if the current route is NOT the top route in the StatefulShellRoute.builder. So underlaying widgets are not in the widget tree, which then won't need to be rendered without layout phase.

Do you have a code example on how to check for this?
I'm guessing I could then create a widget that does this check and place this under the StatefulShellRoute to prevent the tree being processed 👍

Thank for sharing @Gustl22 , unfortunately this approach breaks the statefulness of the shell branch: the page state is not retained when navigating away.


Upgrade Unit Test Framework for Godot 4

The unit test framework we use (GUT) is not quite ready for Godot 4 yet.
In order for godot-playfab to be ready for a Godot 4 release, Unit tests must be working.

[x] Consider another unit Testing framework

[x] If viable, port tests

[ ] Update CI workflow in main.yml to run tests for Godot 4

Using GDUnit 4 now


Document how to apply a class to an Astro component

I've already seen multiple support issues where new Astro developers are struggling with getting syntax like this to work:
<SomeAstroComponent class="some-css-class">
    ...
</SomeAstroComponent>

The challenge is how to get class to be rendered in the HTML output.
This is a typical use case and it's unfortunately also a bit special due to class being seen as a reserved name in JS.
This does not work inside the component frontmatter:
const { class } = Astro.props

You need to rename the property to get it to work, and then use the renamed property in the root element of the component template:
const { class: className } = Astro.props

We should probably document this in an example.

Good idea! Maybe something for the Styling & CSS page?

Good idea! Maybe something for the Styling & CSS page?

Yes, either that, or on the Components page, where there even is a CSS Styles example: https://docs.astro.build/en/core-concepts/astro-components/#css-styles

CSS Styles definitely need iteration.
I'm seeing numerous threads about using the same component twice, and passing in define:vars to the <style> tags overwrites them in the separate components.
This issue is however feels more like a Components/Dynamic Attributes than styling.
At the same time, I wouldn't entirely ditch automating the expected behaviour in some way. If the component consists of a single HTML Tag, it is valid and could be expected to pass the class to that single tag without having to write props and JSX. This is something that probably @natemoo-re could elaborate on, if it's easy/worth to implement. For other use-cases, manually passing in classes feels the way to go.

At the same time, if there is a consensus, I'll gladly update the documentation!

A documentation PR would be great! Even if some kind of automated passing ever comes to pass, I bet it could be a while — sounds like something that would need an RFC given all the complexities — so docs in the meantime would be super helpful. Thanks @lostra01!

I'll ping @sarah11918 here as well, and if everything's in line I'll keep in touch with her throughout the process.

Discussed this on our v1 triage call. Some ideas of where this could go: maybe the troubleshooting page or a future “migration from other frameworks” page?
Not quite sure what’s best — need to think if people need to be presented this while learning or more something they’ll search for if it comes up while working.
There’s some helpful content in #1011 someone might want to pick up and use!


AttributeError: 'StreamResponse' object has no attribute 'body' exception occurs when serving static html

Steps to reproduce:

Setup official demo: https://github.com/aio-libs/aiohttp_debugtoolbar/blob/master/demo/README.rst

Create empty HTML file in static files directory:
$ touch demo/static/test.html

Start demo:
$ python demo/demo.py

Open http://localhost:9000/static/test.html in browser.

Expected behavior: empty html is being rendered in the browser and no errors occurs.
Observed behavior: empty html is being rendered in the browser, but in the console following stack trace occurs:
$ python demo/demo.py
DEBUG:asyncio:Using selector: EpollSelector
DEBUG:demo/demo.py:Server started at http://<IP_ADDRESS>:9000
ERROR:aiohttp.web:Error handling request
Traceback (most recent call last):
  File "/home/bob/stuff/aiohttp_debugtoolbar/demo/aiohttp_debugtoolbar/lib/python3.4/site-packages/aiohttp/server.py", line 272, in start
    yield from self.handle_request(message, payload)
  File "/home/bob/stuff/aiohttp_debugtoolbar/demo/aiohttp_debugtoolbar/lib/python3.4/site-packages/aiohttp/web.py", line 85, in handle_request
    resp = yield from handler(request)
  File "/home/bob/stuff/aiohttp_debugtoolbar/aiohttp_debugtoolbar/middlewares.py", line 141, in toolbar_middleware
    toolbar.inject(request, response)
  File "/home/bob/stuff/aiohttp_debugtoolbar/aiohttp_debugtoolbar/toolbar.py", line 57, in inject
    response_html = response.body
AttributeError: 'StreamResponse' object has no attribute 'body'

Thanks for so clean error report.
Toolbar should pass StreamResponse through gracefully.

Would you make a pull request?

Would you make a pull request?
I barely touched related code in my project and don't know this code at all, so I can't provide fix for it, sorry.

I'll fix it than

Thanks, Andrew!


Put the smoke-test results in the toplevel output.

That way, it is not necessary to unfold the part that
might contain interesting fixed issues.
Signed-off-by: Henner Zeller<EMAIL_ADDRESS>

@hzeller Do you have some screenshots or links to it working?

Here is a link to the summary section in the smoke test
https://github.com/chipsalliance/verible/runs/4047767825?check_suite_focus=true#step:7:695


[WIP] AIP-132 rules.

These are AIP-132 rules similar to the AIP-131 rules added in #80.
As in AIP-131, they are incomplete, because we are not yet able to
read annotations.

This all seems like it can be config driven. E.g. check that a message definition contains required field(s) of specified type. Also, that a message only contains allowed fields from a given set.
All this boilerplate is so much code duplication.

I largely agree, it feels like a lot of work to wire up pretty simple rules. Also, the error handling seems excessive (3-4 error checks per rule) -- is there really no way to make that better?

This all seems like it can be config driven. E.g. check that a message definition contains required field(s) of specified type. Also, that a message only contains allowed fields from a given set.
All this boilerplate is so much code duplication.

I largely agree, it feels like a lot of work to wire up pretty simple rules. Also, the error handling seems excessive (3-4 error checks per rule) -- is there really no way to make that better?

Are you guys talking about the test for the actual rules? Also, is this a Go thing or an api-linter thing? I'm not sure I can see all the boilerplate you're talking about.
Regarding error checks (I assume you're talking about the tests, because I don't see any error checks in your rule), this is one of the biggest complaints of Go. It's largely unavoidable, unless this happens.
One area that looks a bit like duplication is the RuleInfo, but even this has different values for 3 out of the 4 fields in all cases. Aside from that, you're checking different fields, and your checking them for different things. It doesn't feel much like boilerplate to me, but then again, I've been writing Go all quarter :)
Request: can you link me to the implementations of these rules in the python linter?

Request: can you link me to the implementations of these rules in the python linter?

Bad citizenship on my part: I am not actually sure the equivalent rules exist. Sorry....
(I used the AIPs as my launch point, not existing rules.)

Are you guys talking about the tests or the actual rules? Also, is this a Go thing or an api-linter thing? I'm not sure I can see all the boilerplate you're talking about.

Some of both.
I have been discussing this with @alin04 in another venue and I expect that for rules, we can make a series of utility functions that would reduce the effort. For example, it will be really common to want to check that a message has a given type of field, so we might need to have an EnsureField function we can call that takes a message, checks its fields, and does the right thing. You can generalize from that example to probably ~15 or so utility functions that might make this a lot easier.
The tests feel much worse. The setup involves a lot of repetitive error handling, and I have a hard time believing it is completely a Golang thing. I expect (and I want to dig in myself and try it) that what we need is a utility function that takes a template and a struct (and maybe a string prefix) and handles all that error work.
These are really items that I think I should be going and trying to make better and not a "gripe list".


will you add the parsing for SRL tasks?

Will you add the parsing functions for SRL tasks ? or can you show where to add new codes to do that?

why did you close this issue? it seems relevant


Refactor Windows CNI interface configuration

Define separate configureInterfaces funcs for Linux and Windows respectively. The Windows implementation first checks if the container interface has already been created for the infra container, and if yes returns the interfaces based on the information in the interface store.

/test-all


Adding AVX2 code to HAL and Core Arithm

Add AVX2 code for Multiply, Divide, Reciprocal, Compare, and InRange
Also cleans up the SSE2 and NEON code for those function to match the standard.
Adds AVX2 code to the simpler math in HAL.
check_regression=*Multiply*:*Divide*:*reciprocal*:*ompare*:*InRange*:*Norm*:*Sqrt*:*Magnitude*:

I would like to reference #3942 where putting AVX2 code into opencv was discussed half a year ago.
While i really like this step adding AVX2 code i think there are still the same problems mentioned in the discussion above.
Furthermore i just wanted to add that most of modern compilers will automatically evolve sse code to the appropriate and fastest code pretty much everywhere.
So using modern compilers like VS 2013++ or gcc 4.9++ will generate pretty much the same code with optimizations and avx2 enabled.

Hmm.  I had not seen that discussion before.
I wonder if making the universal intrinsics 256 bits would make things easier.  Most of the 128 bit functions would work fine if you just did two of the 128 bit functions in a row. Then you just create a new AVX and AVX2 module.
That, of course, is a somewhat larger project, and doesn't solve the lack of build-farm computers with AVX2.
I do somewhat disagree with the idea that the compiler will match the performance. Some of the functions in this commit are more than 20% faster than without (VS 2015).  It is closer than I expected though.

Yes using own AVX2 code will be a bit faster in most cases but the main improvement (50% to 80% in general) will already be done by the compiler thats my experience. Maybe thats why you only see the 20% difference.
I did some AVX2 tests on warp functions while i needed a large amount of rotating and could only add around 5% to 8% to the speed with own code which was negated in my scenario by the complexity of the user program in the end.

  I see what I did wrong with the 16S code, but the 8U code should be the same.  I just moved it from the cmp_8u to the CmpSMID that's the standard.  I'll make sure I didn't fat finger something later today.

All right, that should take care of it.  The general method only called the vectorized operations for LT, GT, LE, and GE.  So there should also be an improvement for 32S, which was never getting the EQ or NEQ vectorized code called.

@Tetragramm, thank you for the contribution. Since a subset of Intel IPP (IPPICV) can be used for free with OpenCV, it comes with AVX optimization, and it accelerates arithmetic functions, and because in OpenCV 3.x we will be extending OpenCV HAL with support for external acceleration functions (where those AVX optimizations can go), I think, we can close this PR.


Refactor for null actual_spend value

Refactor for the actual_spend value being null for future dates, after the consumption data

Codecov Report

Merging #462 (270b67e) into main (4779ac0) will increase coverage by 0.00%.
The diff coverage is 0.00%.

:exclamation: Current head 270b67e differs from pull request most recent head ca993bd. Consider uploading reports for the commit ca993bd to get more accurate results

Additional details and impacted files

@@          Coverage Diff          @@
##            main    #462   +/-   ##
=====================================
  Coverage   2.16%   2.17%
=====================================
  Files         52      52
  Lines       2081    2073    -8
  Branches     468     466    -2
=====================================
  Hits          45      45
+ Misses      2036    2028    -8

Impacted Files
Coverage Δ

...mmitted-spend-trend/CommittedSpendTrendSummary.tsx
0.00% <ø> (ø)

...itted-spend-trend/CommittedSpendTrendTransform.tsx
0.00% <0.00%> (ø)

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4779ac0...ca993bd. Read the comment docs.


Registering optimizer does not work

I tried registering my own optimizer. I gave a minimal sample code:
import torch
import torch.nn as nn
from torch.optim.optimizer import Optimizer

import higher
from higher.optim import DifferentiableOptimizer

from collections import OrderedDict

class MySGD(Optimizer):

    def __init__(self, params):
        defaults = {}
        super().__init__(params,defaults)

    def _update(self, grouped_grads, **kwargs):
        pass

class MyDiffOpt(DifferentiableOptimizer):

    def _update(self, grouped_grads, **kwargs):
        pass

# initialize model and (original) optimizer
model = nn.Sequential(OrderedDict([('fc', nn.Linear(1,1)),('sigmoid', nn.Sigmoid())]))
other = MySGD(model.parameters())
# get differentiable optimizer
inner_opt = MyDiffOpt(other, model.parameters())
higher.register_optim(MySGD, MyDiffOpt)
with higher.innerloop_ctx(model, inner_opt) as (fmodel, diffopt):
    print(f'diffopt = {diffopt}')

error msg:
Exception has occurred: ValueError
Optimizer type <class '__main__.MyDiffOpt'> not supported by higher yet.

related to issue: https://github.com/facebookresearch/higher/issues/34

This is working as intended. When you call higher.register_optim(MySGD, MyDiffOpt) you are telling higher "hey, just FYI, I wrote MyDiffOpt as a differentiable implementation of MySGD" (as a side note, the library is not responsible for checking that this is actually the case). This then allows you to use high level functions like higher.innerloop_ctx over instances of MySGD which will be mapped to statefully equivalent versions of their differentiable counterpart, as if they had been supported by higher natively. Neat, huh?
What's going wrong in your code is that inner_opt is an instance of MyDiffOpt (a DifferentiableOptimizer subclass) when in fact this function expects a Optimizer subclass instance.
I'll give you feedback on how to do things as I think you want to do them in #34 when I have some time next week.
In the meantime, closing this issue as there's no bug.

This is working as intended. When you call higher.register_optim(MySGD, MyDiffOpt) you are telling higher "hey, just FYI, I wrote MyDiffOpt as a differentiable implementation of MySGD" (as a side note, the library is not responsible for checking that this is actually the case). This then allows you to use high level functions like higher.innerloop_ctx over instances of MySGD which will be mapped to statefully equivalent versions of their differentiable counterpart, as if they had been supported by higher natively. Neat, huh?
What's going wrong in your code is that inner_opt is an instance of MyDiffOpt (a DifferentiableOptimizer subclass) when in fact this function expects a Optimizer subclass instance.
I'll give you feedback on how to do things as I think you want to do them in #34 when I have some time next week.
In the meantime, closing this issue as there's no bug.

ooops your right!