mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-07-09 22:57:21 +00:00
38 lines
1.3 KiB
Dart
38 lines
1.3 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:syncrow_web/utils/color_manager.dart';
|
|
|
|
class CancelButton extends StatelessWidget {
|
|
final String label;
|
|
final VoidCallback? onPressed;
|
|
final double? height; // Optional height parameter for customization
|
|
final double? borderRadius; // Optional border radius customization
|
|
final double? width;
|
|
|
|
const CancelButton({
|
|
super.key,
|
|
required this.label, // Button label
|
|
required this.onPressed, // Button action
|
|
this.height = 40, // Default height
|
|
this.width = 140,
|
|
this.borderRadius = 10, // Default border radius
|
|
});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return ElevatedButton(
|
|
onPressed: onPressed,
|
|
style: ButtonStyle(
|
|
backgroundColor: WidgetStateProperty.all(ColorsManager.boxColor), // White background
|
|
foregroundColor: WidgetStateProperty.all(Colors.black), // Black text color
|
|
shape: WidgetStateProperty.all<RoundedRectangleBorder>(
|
|
RoundedRectangleBorder(
|
|
borderRadius: BorderRadius.circular(borderRadius ?? 10),
|
|
side: const BorderSide(color: ColorsManager.boxColor), // Black border
|
|
),
|
|
),
|
|
fixedSize: WidgetStateProperty.all(Size(width ?? 50, height ?? 40)), // Set button height
|
|
),
|
|
child: Text(label), // Dynamic label
|
|
);
|
|
}
|
|
} |