RoundedButton constructor
RoundedButton({})
Implementation
RoundedButton({
super.key,
required String text,
required super.onPressed,
Color textColor = Colors.white,
double fontSize = 16.0,
double borderRadius = 30.0,
double height = 60.0,
Color? backgroundColor,
String? leadingIcon,
Color? circularProgressBarColor,
bool isLoading = false,
}) : super(
style: ElevatedButton.styleFrom(
minimumSize: Size(double.maxFinite, height),
backgroundColor: backgroundColor ?? AppColors.elfGreen,
// Button background color
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(
borderRadius,
), // Rounded corners
),
),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
if (leadingIcon != null)
Image.asset(leadingIcon, width: 20, height: 20),
if (leadingIcon != null) const SizedBox(width: 4),
isLoading
? SizedBox(
height: 20,
width: 20,
child: CircularProgressIndicator(
color: circularProgressBarColor ?? AppColors.white,
),
)
: InterMediumText(text, color: textColor, fontSize: fontSize),
],
),
);