Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Crash due to MultipleTapGestureRecognizer #690

Closed
jhass opened this issue May 20, 2021 · 4 comments · Fixed by #695
Closed

[BUG] Crash due to MultipleTapGestureRecognizer #690

jhass opened this issue May 20, 2021 · 4 comments · Fixed by #695
Labels
bug Something isn't working

Comments

@jhass
Copy link

jhass commented May 20, 2021

I'm seeing the following crash:

Null check operator used on a null value

Stack trace:

#0 BaseTapGestureRecognizer._checkDown (package:flutter/src/gestures/tap.dart:287)
#1 BaseTapGestureRecognizer.acceptGesture (package:flutter/src/gestures/tap.dart:265)
#2 MultipleTapGestureRecognizer.rejectGesture (package:flutter_html/src/utils.dart:54)
#3 GestureArenaManager._resolve (package:flutter/src/gestures/arena.dart:214)
#4 GestureArenaEntry.resolve (package:flutter/src/gestures/arena.dart:53)
#5 OneSequenceGestureRecognizer.resolve (package:flutter/src/gestures/recognizer.dart:260)
#6 BaseTapGestureRecognizer.resolve (package:flutter/src/gestures/tap.dart:253)
#7 PrimaryPointerGestureRecognizer.handleEvent (package:flutter/src/gestures/recognizer.dart:472)
#8 PointerRouter._dispatch (package:flutter/src/gestures/pointer_router.dart:93)
#9 PointerRouter._dispatchEventToRoutes.<anonymous closure> (package:flutter/src/gestures/pointer_router.dart:138)
#10 _LinkedHashMapMixin.forEach (dart:collection-patch/compact_hash.dart:397)
#11 PointerRouter._dispatchEventToRoutes (package:flutter/src/gestures/pointer_router.dart:136)
#12 PointerRouter.route (package:flutter/src/gestures/pointer_router.dart:122)
#13 GestureBinding.handleEvent (package:flutter/src/gestures/binding.dart:381)
#14 GestureBinding.dispatchEvent (package:flutter/src/gestures/binding.dart:361)
#15 RendererBinding.dispatchEvent (package:flutter/src/rendering/binding.dart:278)
#16 GestureBinding._handlePointerEventImmediately (package:flutter/src/gestures/binding.dart:316)
#17 GestureBinding.handlePointerEvent (package:flutter/src/gestures/binding.dart:280)
#18 GestureBinding._flushPointerEventQueue (package:flutter/src/gestures/binding.dart:238)
#19 GestureBinding._handlePointerDataPacket (package:flutter/src/gestures/binding.dart:221)
#20 _rootRunUnary (dart:async/zone.dart:1370)
#21 _CustomZone.runUnary (dart:async/zone.dart:1265)
#22 _CustomZone.runUnaryGuarded (dart:async/zone.dart:1170)
#23 _invoke1 (dart:ui/hooks.dart:180)
#24 PlatformDispatcher._dispatchPointerDataPacket (dart:ui/platform_dispatcher.dart:276)
#25 _dispatchPointerDataPacket (dart:ui/hooks.dart:96)

This is caused by the current version of MultipleTapGestureRecognizer introduced at #631 and probably originating at https://gist.github.com/Nash0x7E2/08acca529096d93f3df0f60f9c034056

Given the crash happens in Flutter internal state I tried to convince upstream to handle this gracefully but failed to do so: flutter/flutter#82107

Unfortunately my request to suggest a supported solution remained unanswered.

@jhass jhass added the bug Something isn't working label May 20, 2021
@erickok
Copy link
Collaborator

erickok commented May 20, 2021

Hmmm. First of all, thanks for the specific and in-depth issue raised. Indeed it seems the internal assertions are not kept with our MultipleTapGestureRecognizer yet it is not entirely clear what the correct approach then is.

I haven't checked in detail yet but believe we use this for cases where both an image tap and link is used?

@jhass
Copy link
Author

jhass commented May 20, 2021

Yeah, it seems to happen to me if you tap linked images in the wrong way, but not super consistently. It is somewhat race-conditionally.

@tneotia
Copy link
Collaborator

tneotia commented May 21, 2021

I'll have to experiment with this and see what kinds of gestures are in a "passthrough" mode, ie where both the parent and child can see the gesture.

Kind of strange that this functionality isn't supported by flutter, but there may be a workaround.

@tneotia
Copy link
Collaborator

tneotia commented May 22, 2021

Hopefully the above PR is a viable fix for this issue. It does not use any GestureRecognizer workarounds, rather it uses an InheritedWidget.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants