improve player gesture

Signed-off-by: dom <githubaccount56556@proton.me>
This commit is contained in:
dom
2026-05-14 10:56:37 +08:00
parent b33fdf14af
commit 3ac21d95f9
2 changed files with 35 additions and 6 deletions

View File

@@ -0,0 +1,28 @@
import 'package:flutter/gestures.dart'
show ScaleGestureRecognizer, RecognizerCallback, GestureRecognizer;
mixin PlayerGestureMixin on GestureRecognizer {
bool isPosAllowed = true;
@override
T? invokeCallback<T>(
String name,
RecognizerCallback<T> callback, {
String Function()? debugReport,
}) {
if (!isPosAllowed) return null;
return super.invokeCallback(name, callback, debugReport: debugReport);
}
}
class PlayerScaleGestureRecognizer extends ScaleGestureRecognizer
with PlayerGestureMixin {
PlayerScaleGestureRecognizer({
super.debugOwner,
super.supportedDevices,
super.allowedButtonsFilter,
super.dragStartBehavior,
super.trackpadScrollCausesScale,
super.trackpadScrollToScaleFactor,
});
}