buttonContent property

Widget get buttonContent

Implementation

Widget get buttonContent {
  Color textColor;
  switch (type) {
    case ButtonType.text:
    case ButtonType.secondary:
      textColor = ColorTokens.primary_blue_30;
      break;
    default:
      textColor = Colors.white;
      break;
  }
  if (isLoading) return CircularProgressIndicator(color: Color(0xFF58D890));
  Widget textWidget = Text(
    text,
    style: TextStyle(color: textColor, fontSize: 16),
  );
  if (icon == null) return textWidget;
  return Row(mainAxisAlignment: MainAxisAlignment.center, children: [
    Icon(icon, color: Colors.white),
    SizedBox(width: 8),
    textWidget,
  ]);
}