You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
39 lines
998 B
Dart
39 lines
998 B
Dart
import 'package:flutter/material.dart';
|
|
import 'package:mc_common_app/extensions/string_extensions.dart';
|
|
import 'package:mc_common_app/theme/colors.dart';
|
|
|
|
class CustomButton extends StatelessWidget {
|
|
final Function() onTapped;
|
|
final Color? backgroundColor;
|
|
final String buttonText;
|
|
final double? textFontSize;
|
|
|
|
final Color textColor;
|
|
final bool? isIcon;
|
|
final double? buttonHeight;
|
|
|
|
const CustomButton({
|
|
Key? key,
|
|
required this.onTapped,
|
|
required this.buttonText,
|
|
this.isIcon = false,
|
|
this.backgroundColor = MyColors.primaryColor,
|
|
this.textColor = MyColors.white,
|
|
this.buttonHeight = 55,
|
|
this.textFontSize = 15,
|
|
}) : super(key: key);
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Container(
|
|
height: buttonHeight,
|
|
color: backgroundColor,
|
|
alignment: Alignment.center,
|
|
child: InkWell(
|
|
onTap: onTapped,
|
|
child: buttonText.toText(fontSize: textFontSize, color: textColor),
|
|
),
|
|
);
|
|
}
|
|
}
|