Sitelet https://github.com/letsar/flutter_slidable/pull/235
Skip to content

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

Closed
nguyenxdat wants to merge 1 commit into
letsar:masterfrom
nguyenxdat:master
Closed

nguyenxdat wants to merge 1 commit into
letsar:masterfrom
nguyenxdat:master

Conversation

@nguyenxdat

@nguyenxdat nguyenxdat commented Jul 30, 2021 •

Copy link
Copy Markdown

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

letsar commented Jul 31, 2021

Copy link
Copy Markdown
Owner

I cannot reproduce, on which Flutter branch are you?

@nguyenxdat

nguyenxdat commented Aug 2, 2021 •

Copy link
Copy Markdown
Author

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

@letsar

letsar commented Aug 3, 2021

Copy link
Copy Markdown
Owner

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.

2 participants