Commit bec1b9a1 authored by Hey24sheep's avatar Hey24sheep Committed by Shi-Hao Hong

Optimize gesture recognizer instantiation (#35979)

parent 13382f41
......@@ -268,13 +268,14 @@ class LongPressGestureRecognizer extends PrimaryPointerGestureRecognizer {
void _checkLongPressStart() {
assert(_initialButtons == kPrimaryButton);
final LongPressStartDetails details = LongPressStartDetails(
globalPosition: _longPressOrigin.global,
localPosition: _longPressOrigin.local,
);
if (onLongPressStart != null)
if (onLongPressStart != null) {
final LongPressStartDetails details = LongPressStartDetails(
globalPosition: _longPressOrigin.global,
localPosition: _longPressOrigin.local,
);
invokeCallback<void>('onLongPressStart',
() => onLongPressStart(details));
}
if (onLongPress != null)
invokeCallback<void>('onLongPress', onLongPress);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment