2026-05-18 15:52:09 +02:00
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
|
2026-07-02 00:37:54 +02:00
|
|
|
import '../utils/platform_detector.dart';
|
|
|
|
|
|
2026-05-18 15:52:09 +02:00
|
|
|
class ClickableCursor extends StatelessWidget {
|
|
|
|
|
final Widget child;
|
|
|
|
|
final bool enabled;
|
|
|
|
|
|
|
|
|
|
const ClickableCursor({super.key, required this.child, this.enabled = true});
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
2026-07-05 02:23:42 +02:00
|
|
|
// Cursor feedback only matters where a pointer exists: skip the
|
|
|
|
|
// MouseRegion on TV and touch handhelds — one exists per card and they
|
|
|
|
|
// add up on low-end devices.
|
|
|
|
|
if (!PlatformDetector.isDesktopOS()) return child;
|
2026-05-18 15:52:09 +02:00
|
|
|
return MouseRegion(cursor: enabled ? SystemMouseCursors.click : MouseCursor.defer, child: child);
|
|
|
|
|
}
|
|
|
|
|
}
|