filament_verwaltung/lib/widgets/action_button.dart
2026-01-15 11:40:09 +01:00

47 lines
1.2 KiB
Dart

import 'package:flutter/material.dart';
class ActionButton extends StatelessWidget {
final IconData icon;
final String label;
final Color color;
final VoidCallback onPressed;
final bool isOutlined;
const ActionButton({
super.key,
required this.icon,
required this.label,
required this.color,
required this.onPressed,
this.isOutlined = false,
});
@override
Widget build(BuildContext context) {
return ElevatedButton.icon(
onPressed: onPressed,
icon: Icon(icon, size: 20),
label: Text(
label,
style: TextStyle(
fontSize: 15,
fontWeight: FontWeight.w600,
),
),
style: ElevatedButton.styleFrom(
backgroundColor: isOutlined ? Colors.white : color,
foregroundColor: isOutlined ? color : Colors.white,
padding: EdgeInsets.symmetric(horizontal: 20, vertical: 14),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(12),
side: isOutlined
? BorderSide(color: color, width: 2)
: BorderSide.none,
),
elevation: isOutlined ? 0 : 3,
shadowColor: color.withAlpha(140),
),
);
}
}