TDButtonStyle.generateOutlineStyleByTheme constructor

TDButtonStyle.generateOutlineStyleByTheme(
  1. BuildContext context,
  2. TDButtonTheme? theme,
  3. TDButtonStatus status
)

生成不同主题的描边按钮样式

Implementation

TDButtonStyle.generateOutlineStyleByTheme(
    BuildContext context, TDButtonTheme? theme, TDButtonStatus status) {
  switch (theme) {
    case TDButtonTheme.primary:
      textColor = _getBrandColor(context, status);
      backgroundColor = status == TDButtonStatus.active ? TDTheme.of(context).grayColor3 : TDTheme.of(context).whiteColor1;
      frameColor = textColor;
      break;
    case TDButtonTheme.danger:
      textColor = _getErrorColor(context, status);
      backgroundColor = status == TDButtonStatus.active ? TDTheme.of(context).grayColor3 : TDTheme.of(context).whiteColor1;
      frameColor = textColor;
      break;
    case TDButtonTheme.light:
      textColor = _getBrandColor(context, status);
      backgroundColor = _getLightColor(context, status);
      frameColor = textColor;
      break;
    case TDButtonTheme.defaultTheme:
    default:
      textColor = _getDefaultTextColor(context, status);
      backgroundColor = _getOutlineDefaultBgColor(context, status);
      frameColor = TDTheme.of(context).grayColor4;
  }
  frameWidth = 1;
}