-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Description
Is there an existing issue for this?
- I have searched the existing issues
- I have read the guide to filing a bug
Use case
Similar to #43833. We should be able to get the sourceTimeStamp being that you can do so in onPanUpdate like so:
onPanUpdate: (DragUpdateDetails details){
print(details.sourceTimeStamp);
}My specific use case involves converting a scale event to a vertical drag event which requires sourceTimeStamp. A perhaps more reasonable use case would be to track the velocity of a "pan" event (meaning a pan event from a scale event) in eg. InteractiveViewer using a VelocityTracker, which requires a time in its addPosition method. This could be useful when eg. trying to detect when a user wants to close the InteractiveViewer.
Proposal
I'm not sure where sourceTimeStamp comes from. It doesn't seem to be used in gesture_detector.dart so I don't know where to add it. If scale really is a superset of pan I imagine it should not be difficult to add it. If anyone knows how to add it I would like to know. I see it is defined in drag_details.dart for pan but I can't imagine adding sourceTimeStamp to ScaleUpdateDetails in scale.dart alone would be enough.