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

Fix bug Field 'lastPosition' has not been initialized when pressed #235

Closed
wants to merge 1 commit into from

Conversation

nguyenxdat
Copy link

@nguyenxdat nguyenxdat commented Jul 30, 2021

When the user pressed (not drag item) this error occurs

════════ Exception caught by gesture ═══════════════════════════════════════════
The following LateError was thrown while handling a gesture:
LateInitializationError: Field 'lastPosition' has not been initialized.

When the exception was thrown, this was the stack
#0      _SlidableGestureDetectorState.lastPosition (package:flutter_slidable/src/gesture_detector.dart)
package:flutter_slidable/src/gesture_detector.dart:1
#1      _SlidableGestureDetectorState.handleDragEnd
package:flutter_slidable/src/gesture_detector.dart:93
#2      DragGestureRecognizer._checkEnd.<anonymous closure>
package:flutter/…/gestures/monodrag.dart:473
#3      GestureRecognizer.invokeCallback
package:flutter/…/gestures/recognizer.dart:182
#4      DragGestureRecognizer._checkEnd
package:flutter/…/gestures/monodrag.dart:473
...
Handler: "onEnd"
Recognizer: HorizontalDragGestureRecognizer#c5a3b
    debugOwner: GestureDetector
    start behavior: down
════════════════════════════════════════════════════════════════════════════════
Application finished.

@letsar
Copy link
Owner

letsar commented Jul 31, 2021

I cannot reproduce, on which Flutter branch are you?

@nguyenxdat
Copy link
Author

nguyenxdat commented Aug 2, 2021

I used to flutter_slidable 1.0.0-dev.8 version at
video demo
code demo
@letsar

@letsar
Copy link
Owner

letsar commented Aug 3, 2021

Oh thanks, I've been able to fix it by another way in the 1.0.0-dev.9. I'm closing this it's published. Thank you again for the repro case 👍

@letsar letsar closed this Aug 3, 2021
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

Successfully merging this pull request may close these issues.

None yet

2 participants