You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
66 lines
1.7 KiB
66 lines
1.7 KiB
2 years ago
|
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,
|
||
|
),
|
||
|
),
|
||
|
),
|
||
|
);
|
||
|
}
|
||
|
}
|