fixWidgetStyle method

Widget fixWidgetStyle(
  1. Widget widget,
  2. Color color
)

Adjusts the widget style based on the state and theme.

Implementation

Widget fixWidgetStyle(Widget widget, Color color) {
  if (widget is Text) {
    double size = 12.0;
    return Text(
      widget.data!,
      style: widget.style?.copyWith(color: color, fontSize: size) ??
          TextStyle(color: color, fontSize: size),
    );
  }
  if (widget is Icon) {
    return Icon(
      widget.icon,
      color: color,
      size: 14.0,
    );
  }
  return widget;
}