fixWidgetStyle method

Widget fixWidgetStyle(
  1. Widget child,
  2. int index,
  3. CDKTheme theme
)

Implementation

Widget fixWidgetStyle(Widget child, int index, CDKTheme theme) {
  Color color = theme.isLight
      ? widget.selectedStates[index] && theme.isAppFocused
          ? CDKTheme.white
          : CDKTheme.black
      : widget.selectedStates[index] && !theme.isAppFocused
          ? CDKTheme.black
          : CDKTheme.white;
  if (child is Text) {
    double size = 12.0;
    return Text(
      child.data!,
      style: child.style?.copyWith(color: color, fontSize: size) ??
          TextStyle(color: color, fontSize: size),
    );
  }
  if (child is Icon) {
    return Icon(
      child.icon,
      color: color,
      size: 14.0,
    );
  }
  return child;
}