import 'package:flutter/material.dart'; import 'app_colors.dart'; import 'primary_text.dart'; class PrimaryButton extends StatelessWidget { final String title; final VoidCallback onPressed; final double verticalPadding; final bool textAllCaps; final double textSize; final FontWeight textWeight; final Color textColor; final TextDecoration textDecoration; final int letterSpacing; final bool isResponsive; final Color bgColor; final double horizontalPadding; const PrimaryButton({ Key? key, required this.title, required this.onPressed, this.verticalPadding = 10.0, this.textAllCaps = true, this.textSize = 14, this.textWeight = FontWeight.w500, this.textColor = Colors.white, this.textDecoration = TextDecoration.none, this.letterSpacing = 1, this.isResponsive = true, this.bgColor = AppColors.primaryColor, this.horizontalPadding = 25.0, }) : super(key: key); @override Widget build(BuildContext context) { return Card( shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(40), ), color: bgColor, child: InkWell( onTap: onPressed, child: Padding( padding: EdgeInsets.symmetric( vertical: verticalPadding, horizontal: horizontalPadding, ), child: PrimaryText( textAllCaps ? title.toUpperCase() : title, // title.toUpperCase(), textAlign: TextAlign.center, fontSize: textSize, fontWeight: textWeight, fontColor: textColor, textDecoration: textDecoration, isResponsive: isResponsive, ), ), ), ); } }