Files
PiliPlus/lib/plugin/pl_player/widgets/common_btn.dart
bggRGjQaUbCoE 0745d83e4b feat: ai translate
Closes #1285

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
2025-09-20 14:10:31 +08:00

39 lines
795 B
Dart

import 'package:flutter/material.dart';
class ComBtn extends StatelessWidget {
final Widget icon;
final VoidCallback? onTap;
final VoidCallback? onLongPress;
final double width;
final double height;
final String? tooltip;
const ComBtn({
super.key,
required this.icon,
this.onTap,
this.onLongPress,
this.width = 34,
this.height = 34,
this.tooltip,
});
@override
Widget build(BuildContext context) {
final child = SizedBox(
width: width,
height: height,
child: GestureDetector(
onTap: onTap,
onLongPress: onLongPress,
behavior: HitTestBehavior.opaque,
child: icon,
),
);
if (tooltip != null) {
return Tooltip(message: tooltip, child: child);
}
return child;
}
}