import 'package:flutter/material.dart';

class DefaultButton extends StatelessWidget {
  final String text;
  final VoidCallback onPress;
  final Color textColor;
  final Color color;
  final Color disabledColor;
  final IconData iconData;
  final double fontSize;
  DefaultButton(this.text, this.onPress, {this.color, this.disabledColor, this.textColor = Colors.white, this.iconData, this.fontSize});

  @override
  Widget build(BuildContext context) {
    return SizedBox(
      height: 43,
      width: double.infinity,
      child: FlatButton(
        onPressed: onPress,
        child: Row(
          children: [
            if (iconData != null) Icon(iconData, color: textColor),
            Expanded(
              child: Text(
                text,
                textAlign: TextAlign.center,
                style: TextStyle(fontSize: fontSize ?? 16, fontWeight: FontWeight.w600, color: textColor, letterSpacing: -0.48),
              ),
            ),
          ],
        ),
        //     color: Color(0xffD02127),
        color: color ?? const Color(0xffD02127),
        disabledColor: disabledColor,
        shape: RoundedRectangleBorder(
          borderRadius: BorderRadius.circular(6),
        ),
      ),
    );
  }
}
