defaultButton function

Widget defaultButton({
  1. dynamic color,
  2. bool border = true,
  3. required Color textColor,
  4. double width = double.infinity,
  5. double height = 50.0,
  6. double textSize = 18.0,
  7. required dynamic text,
  8. required Function function,
})

Implementation

Widget defaultButton(
        {var color,
        bool border = true,
        required Color textColor,
        double width = double.infinity,
        double height = 50.0,
        double textSize = 18.0,
        required text,
        required Function function}) =>
    Container(
      width: width,
      decoration: BoxDecoration(
          color: color,
          borderRadius: BorderRadius.circular(8.0),
          border: border
              ? Border.all(color: textColor == Colors.white ? color : textColor)
              : null),
      height: height,
      child: MaterialButton(
        child: FittedBox(
          child: Text(
            text,
            style: TextStyle(color: textColor, fontSize: textSize),
          ),
        ),
        onPressed: () {
          function();
        },
      ),
    );