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

CastError - Null check operator used on a null value #1

Closed
larssn opened this issue Jun 17, 2021 · 6 comments
Closed

CastError - Null check operator used on a null value #1

larssn opened this issue Jun 17, 2021 · 6 comments

Comments

@larssn
Copy link

larssn commented Jun 17, 2021

positioned_tap_detector_2.dart in _TapPositionDetectorState._onLongPressEvent at line 117 within positioned_tap_detector_2

It seems _pendingTap can be null occasionally when _onLongPressEvent is called. Instead of using the bang operator, wouldn't it be better to just use actual null checks?

@arsamme
Copy link
Owner

arsamme commented Jun 22, 2021

@larssn
Hi, As I don't have free time to work on side projects, Would you please solve this and create PR?

@larssn
Copy link
Author

larssn commented Jun 22, 2021

Same, very busy. If I get time, I'll squeeze in a PR.

@greensopinion
Copy link
Contributor

I had the same issue:


Null check operator used on a null value
#0      _TapPositionDetectorState._onLongPressEvent (package:positioned_tap_detector_2/positioned_tap_detector_2.dart:117)
#1      PositionedTapController.onLongPress (package:positioned_tap_detector_2/positioned_tap_detector_2.dart:179)
#2      GestureRecognizer.invokeCallback (package:flutter/src/gestures/recognizer.dart:182)
#3      LongPressGestureRecognizer._checkLongPressStart (package:flutter/src/gestures/long_press.dart:423)
#4      LongPressGestureRecognizer.didExceedDeadline (package:flutter/src/gestures/long_press.dart:372)
#5      PrimaryPointerGestureRecognizer.didExceedDeadlineWithEvent (package:flutter/src/gestures/recognizer.dart:501)
#6      PrimaryPointerGestureRecognizer.addAllowedPointer.<anonymous closure> (package:flutter/src/gestures/recognizer.dart:454)
#7      _rootRun (dart:async/zone.dart:1346)
#8      _CustomZone.run (dart:async/zone.dart:1258)

The PR above should address it.

@arsamme
Copy link
Owner

arsamme commented Sep 29, 2021

@greensopinion Thank you, I've merged your PR and I'll release it on pub soon

@greensopinion
Copy link
Contributor

greensopinion commented Sep 29, 2021 via email

@arsamme
Copy link
Owner

arsamme commented Oct 4, 2021

@greensopinion sorry for updating too late. done. I'll close this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants