mirror of
https://github.com/venera-app/venera.git
synced 2025-09-27 15:57:25 +00:00
23 lines
496 B
Dart
23 lines
496 B
Dart
part of 'components.dart';
|
|
|
|
class MouseBackDetector extends StatelessWidget {
|
|
const MouseBackDetector({super.key, required this.onTapDown, required this.child});
|
|
|
|
final Widget child;
|
|
|
|
final void Function() onTapDown;
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Listener(
|
|
onPointerDown: (event) {
|
|
if (event.buttons == kBackMouseButton) {
|
|
onTapDown();
|
|
}
|
|
},
|
|
behavior: HitTestBehavior.translucent,
|
|
child: child,
|
|
);
|
|
}
|
|
}
|