Skip to content

ScaleUpdateDetails should give sourceTimeStamp #135873

@yakagami

Description

@yakagami

Is there an existing issue for this?

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Issues that are less important to the Flutter projectc: new featureNothing broken; request for a new capabilityc: proposalA detailed proposal for a change to Flutterf: gesturesflutter/packages/flutter/gestures repository.frameworkflutter/packages/flutter repository. See also f: labels.r: fixedIssue is closed as already fixed in a newer versionteam-frameworkOwned by Framework teamtriaged-frameworkTriaged by Framework team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions