getButtonBorder method

Border getButtonBorder()

Returns the appropriate border for the button based on its type.

If type is BtnType.outline, returns a border with the specified outlineColor or defaults to FxColor.gray200 with a width of 1.

If type is BtnType.outline2x, returns a border with the specified outlineColor or defaults to FxColor.gray200 with a width of 2.

If type is neither BtnType.outline nor BtnType.outline2x, returns a border with no style.

Implementation

Border getButtonBorder() {
  if (type == BtnType.outline || type == BtnType.outline2x) {
    return Border.all(
      color: outlineColor ?? color ?? FxColor.gray200,
      width: type == BtnType.outline2x ? 2 : 1,
    );
  }
  return Border.all(width: 0, color: Colors.transparent);
}