getButtonBorderSide function

BorderSide getButtonBorderSide(
  1. EasyButtonType? type,
  2. bool? ghost
)

获取按钮的边框 border

Implementation

BorderSide getButtonBorderSide(EasyButtonType? type, bool? ghost) {
  BorderSide borderSide = const BorderSide(color: iBorderColor, width: 1.0);
  if (type == null) return borderSide;
  bool isGhost = ghost != null && ghost;
  switch (type) {
    case EasyButtonType.primary:
      borderSide = isGhost ? const BorderSide(color: iPrimary, width: 1.0) : BorderSide.none;
      break;
    case EasyButtonType.info:
      borderSide = isGhost ? const BorderSide(color: iInfo, width: 1.0) : BorderSide.none;
      break;
    case EasyButtonType.success:
      borderSide = isGhost ? const BorderSide(color: iSuccess, width: 1.0) : BorderSide.none;
      break;
    case EasyButtonType.warn:
      borderSide = isGhost ? const BorderSide(color: iWarn, width: 1.0) : BorderSide.none;
      break;
    case EasyButtonType.error:
      borderSide = isGhost ? const BorderSide(color: iError, width: 1.0) : BorderSide.none;
      break;
    case EasyButtonType.text:
      borderSide = BorderSide.none;
      break;
  }
  return borderSide;
}