border method

ElevatedButton border({
  1. bool hasBorder = false,
})

extension to set the border on the ElevatedButton widget

Implementation

ElevatedButton border({bool hasBorder = false}) {
  if (!hasBorder) return this;
  return ElevatedButton(
    style: ElevatedButton.styleFrom(
        backgroundColor: Colors.transparent,
        shadowColor: Colors.transparent,
        elevation: 0,
        shape: RoundedRectangleBorder(
            borderRadius: BorderRadius.circular(5),
            side: BorderSide(width: 1, color: ClassColors.mtPrimary_5))),
    onPressed: onPressed,
    key: key,
    child: child,
  );
}