mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
Use the actual pipeline owner for this assert. (#7400)
This commit is contained in:
parent
84cf54892d
commit
cd92e11f17
@ -382,11 +382,7 @@ class RawGestureDetectorState extends State<RawGestureDetector> {
|
||||
/// the gesture detector should be enabled.
|
||||
void replaceGestureRecognizers(Map<Type, GestureRecognizerFactory> gestures) {
|
||||
assert(() {
|
||||
// TODO kgiesing This assert will trigger if the owner of the current
|
||||
// tree is different from the owner assigned to the renderer instance.
|
||||
// Once elements have a notion of owners this assertion can be written
|
||||
// more clearly.
|
||||
if (!RendererBinding.instance.pipelineOwner.debugDoingLayout) {
|
||||
if (!context.findRenderObject().owner.debugDoingLayout) {
|
||||
throw new FlutterError(
|
||||
'Unexpected call to replaceGestureRecognizers() method of RawGestureDetectorState.\n'
|
||||
'The replaceGestureRecognizers() method can only be called during the layout phase. '
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user