Files
iroute/lib/components/windows/drag_to_move_area.dart
2023-11-20 20:05:05 +08:00

25 lines
559 B
Dart

import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:window_manager/window_manager.dart';
class DragToMoveWrap extends StatelessWidget {
final Widget child;
const DragToMoveWrap({
Key? key,
required this.child,
}) : super(key: key);
@override
Widget build(BuildContext context) {
if(kIsWeb) return child;
return GestureDetector(
behavior: HitTestBehavior.translucent,
onPanStart: (details) {
windowManager.startDragging();
},
child: child,
);
}
}