DiscoverModule/lib/contacts_module/ui_screen/interactionform/widget/custombutton.dart

49 lines
1.2 KiB
Dart
Raw Permalink Normal View History

2024-05-20 10:29:02 +00:00
import 'package:flutter/material.dart';
// ignore: must_be_immutable
class CustomButton extends StatelessWidget {
String title;
Color textColor;
Color backgroundColor;
VoidCallback onPressed;
double? width = 200;
double? height = 45.0;
double? fontsize = 45.0;
CustomButton(
{super.key,
required this.backgroundColor,
required this.onPressed,
required this.textColor,
required this.title,
this.fontsize,
this.height,
this.width});
@override
Widget build(BuildContext context) {
return SizedBox(
height: height,
width: width,
child: ElevatedButton(
onPressed: onPressed,
2024-05-21 08:40:44 +00:00
// style: ButtonStyle(
// backgroundColor:
// MaterialStateColor.resolveWith((states) => backgroundColor),
// ),
style: ElevatedButton.styleFrom(
2024-05-20 10:29:02 +00:00
backgroundColor:
MaterialStateColor.resolveWith((states) => backgroundColor),
2024-05-21 08:40:44 +00:00
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10), // <-- Radius
),
2024-05-20 10:29:02 +00:00
),
2024-05-21 08:40:44 +00:00
2024-05-20 10:29:02 +00:00
child: Text(
title,
style: TextStyle(color: textColor, fontSize: fontsize ?? 24.0),
),
),
);
}
}