Use the actual pipeline owner for this assert. (#7400)

This commit is contained in:
Ian Hickson 2017-01-09 16:33:25 -08:00 committed by GitHub
parent 84cf54892d
commit cd92e11f17

View File

@ -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. '