twonly-app/lib/src/components/image_editor/action_button.dart
2025-02-04 00:22:18 +01:00

42 lines
1,021 B
Dart

import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
class ActionButton extends StatelessWidget {
final VoidCallback? onPressed;
final IconData? icon;
final Color? color;
final String tooltipText;
final bool disable;
const ActionButton(this.icon,
{super.key,
this.onPressed,
this.color,
required this.tooltipText,
this.disable = false});
@override
Widget build(BuildContext context) {
return Tooltip(
message: tooltipText,
child: IconButton(
icon: FaIcon(
icon,
size: 30,
color: disable
? const Color.fromARGB(154, 255, 255, 255)
: color ?? Colors.white,
shadows: [
Shadow(
color: const Color.fromARGB(122, 0, 0, 0),
blurRadius: 5.0,
)
],
),
onPressed: () {
if (!disable && onPressed != null) onPressed!();
},
),
);
}
}