Repository navigation
Closed
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work lista: error messageError messages from the Flutter frameworkError messages from the Flutter frameworkf: routesNavigator, Router, and related APIs.Navigator, Router, and related APIs.f: selectionSelectableRegion, SelectionArea, SelectionContainer, Selectable, and related APIsSelectableRegion, SelectionArea, SelectionContainer, Selectable, and related APIsfound in release: 3.3Found to occur in 3.3Found to occur in 3.3found in release: 3.7Found to occur in 3.7Found to occur in 3.7frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onteam-frameworkOwned by Framework teamOwned by Framework teamtriaged-frameworkTriaged by Framework teamTriaged by Framework teamwaiting for responseThe Flutter team cannot make further progress on this issue until the original reporter respondsThe Flutter team cannot make further progress on this issue until the original reporter responds
Description
Steps to Reproduce
Wrapping a page with a selection area will not work if it is not the topmost route. Likely not an issue with GoRouter just my router of choice to demonstrate the issue.
Expected results:
I would expect SelectionArea to not cause any issues when wrapping my routes.
Actual results:
If I was to load the app on the initial/lowest route, then navigate to the nested route, all would work fine.
But if I go straight to the nested route, such as you might on the web, the error occurs.
Code sample
final router = GoRouter(
// Default to the nested location
// Or for a more realistic use-case, navigate to the url /a/b on the web
initialLocation: '/a/b',
routes: [
GoRoute(
path: '/a',
builder: (_, __) {
// With selection area here, error will occur
return const SelectionArea(child: Text('Page a'));
// With no selection area here, error will not occur
// return Text('Page a');
},
routes: [
GoRoute(
path: 'b',
builder: (_, __) {
return const SelectionArea(child: Text('Page b'));
},
),
],
),
],
);Logs
════════ Exception caught by scheduler library ═════════════════════════════════
The following assertion was thrown during a scheduler callback:
'package:flutter/src/rendering/paragraph.dart': Failed assertion: line 963 pos 12: '!debugNeedsLayout': is not true.
package:flutter/…/rendering/paragraph.dart:963
2
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.md
When the exception was thrown, this was the stack
#2 RenderParagraph.getBoxesForSelection
package:flutter/…/rendering/paragraph.dart:963
#3 _SelectableFragment._rect
package:flutter/…/rendering/paragraph.dart:1501
#4 _SelectableFragment.getTransformToParagraph
package:flutter/…/rendering/paragraph.dart:1475
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.3.10, on macOS 12.6 21G115 darwin-arm, locale
en-AU)
[✓] Android toolchain - develop for Android devices (Android SDK version
33.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 14.2)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2021.3)
[✓] VS Code (version 1.74.1)
[✓] Connected device (3 available)
[✓] HTTP Host Availability
• No issues found!
Reacted by Tomasz Wyrowiński and Piglettank
Metadata
Metadata
Assignees
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work lista: error messageError messages from the Flutter frameworkError messages from the Flutter frameworkf: routesNavigator, Router, and related APIs.Navigator, Router, and related APIs.f: selectionSelectableRegion, SelectionArea, SelectionContainer, Selectable, and related APIsSelectableRegion, SelectionArea, SelectionContainer, Selectable, and related APIsfound in release: 3.3Found to occur in 3.3Found to occur in 3.3found in release: 3.7Found to occur in 3.7Found to occur in 3.7frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onteam-frameworkOwned by Framework teamOwned by Framework teamtriaged-frameworkTriaged by Framework teamTriaged by Framework teamwaiting for responseThe Flutter team cannot make further progress on this issue until the original reporter respondsThe Flutter team cannot make further progress on this issue until the original reporter responds
Type
Projects
- StatusShow more project fieldsDone
Activity
darshankawar commentedon Dec 22, 2022
Thanks for the report.
Using the code sample provided, seeing the same behavior as reported.
stable, master flutter doctor -v
goderbauer commentedon Jan 3, 2023
cc @chunhtai
Renzo-Olivares commentedon Feb 19, 2026
I was not able to reproduce this issue on the latest
mastercommit. @k-ane is this something you are still experiencing? This seems similar to #151536 which I can reproduce. If, so maybe we can close this one in favor of that one.github-actions commentedon Mar 12, 2026
Without additional information, we are unfortunately not sure how to resolve this issue. We are therefore reluctantly going to close this bug for now.
If you find this problem please file a new issue with the same description, what happens, logs and the output of 'flutter doctor -v'. All system setups can be slightly different so it's always better to open new issues and reference the related ones.
Thanks for your contribution.
github-actions commentedon Mar 26, 2026
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.