-
-
Notifications
You must be signed in to change notification settings - Fork 503
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 report] onDragEnd gesture -> Null check operator used on a null value #601
Comments
could you provide a simple runnable demo to reproduce your issue? |
@zmtzawqlp , unfortunately no. This is reproduced by real users. i only have stats. And in code of library
but ok. Its work. And here used In the method
maybe error here |
_drag should not be null at that moment , it's better to reproduce it so that i can bug it. |
no, drug = null, because u a set null when start
let me fork it, fix this string, look at the stats, and if it helps, I'll make a requisition for the extended_image |
i mean that it should not be null at that moment(onDragEnd). _disposeDrag callback is called after onDragEnd |
@zmtzawqlp , shouldn't, but there is. analytics and stacktrace of the exception says that this place is null |
so we should better find out the case of this issue, not simplely use '?' instead of '!'. |
@zmtzawqlp , so it is, after all, for the reason that he wrote above: at the beginning of the gesture, |
@zmtzawqlp , please review |
Hi guy, thank you very much for reporting this issue. |
@zmtzawqlp |
here is a diagram showing that when switching to a new version of the application, in which the line was corrected, as in the attached request ( https://github.com//pull/620 ) , the error disappears. the smoothness of the graphics is ensured by the gradual rolling out of the new version. |
Hi, It is not recommended to use the bang operator to interact with gestures. When checking using null-aware access, the method will simply fail if the value is null. |
Those codes are from https://github.com/flutter/flutter/blob/e8ff2aed31692142fb3494e2ee8b5b11d3e28693/packages/flutter/lib/src/widgets/scrollable.dart#L831 it is already use '?' here, and I believe our modification won't introduce any other issues. Thanks again for your pull request and explanation. LGTM |
Version
8.0.2
Platforms
dart, Android, iOS
Device Model
All devices, Galaxy A12, Galaxy A32, Galaxy A13, Redmi 8A, Redmi 9C, Redmi Note 8
flutter info
How to reproduce?
Use
ExtendedImageGesturePageView.builder
and try to executeonDrag
gesture. The exception will be throw foronDragEnd
callbackLogs
Example code (optional)
Contact
https://github.com/EgorK0rshun,
korshun.dev@gmail.com
The text was updated successfully, but these errors were encountered: