getButtonTextColor function

Color getButtonTextColor(
  1. EasyButtonType? type,
  2. bool? ghost
)

获取按钮的文本颜色

Implementation

Color getButtonTextColor(EasyButtonType? type, bool? ghost) {
  Color textColor = iBlack;
  if (type == null) return textColor;
  bool isGhost = ghost != null && ghost;
  switch (type) {
    case EasyButtonType.primary:
      textColor = isGhost ? iPrimary : iWhite;
      break;
    case EasyButtonType.info:
      textColor = isGhost ? iInfo : iWhite;
      break;
    case EasyButtonType.success:
      textColor = isGhost ? iSuccess : iWhite;
      break;
    case EasyButtonType.warn:
      textColor = isGhost ? iWarn : iWhite;
      break;
    case EasyButtonType.error:
      textColor = isGhost ? iError : iWhite;
      break;
    case EasyButtonType.text:
      textColor = iBlack;
      break;
    default:
      textColor = iBlack;
      break;
  }
  return textColor;
}