-
Notifications
You must be signed in to change notification settings - Fork 29.8k
Open
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 frameworka: qualityA truly polished experienceA truly polished experienceframeworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.team-frameworkOwned by Framework teamOwned by Framework teamtriaged-frameworkTriaged by Framework teamTriaged by Framework team
Description
Right now we assert(_debugCanPerformMutations) in various places, notably markNeedsLayout. We should instead make _debugCanPerformMutations into some sort of validator function that throws useful error messages for each condition that would otherwise have made the assert fail. For example, I just got this:
══╡ EXCEPTION CAUGHT BY FOUNDATION LIBRARY ╞════════════════════════════════════════════════════════
The following assertion was thrown while dispatching notifications for ListViewSelectionController:
'package:flutter/src/rendering/object.dart': Failed assertion: line 1609 pos 12:
'_debugCanPerformMutations': 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.md
When the exception was thrown, this was the stack:
#2 RenderObject.markNeedsLayout (package:flutter/src/rendering/object.dart:1609:12)
#3 RenderBox.markNeedsLayout (package:flutter/src/rendering/box.dart:2320:11)
...
...because my RenderObject was disposed at the time I called markNeedsLayout, but to find that out I had to instrument _debugCanPerformMutations to print out which condition was making it return false.
vs-krasnov
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 frameworka: qualityA truly polished experienceA truly polished experienceframeworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.team-frameworkOwned by Framework teamOwned by Framework teamtriaged-frameworkTriaged by Framework teamTriaged by Framework team