Color? toColor(String? hexColor) { if (hexColor == null) { return null; } final hexCode = hexColor.replaceFirst('#', ''); return Color(int.parse('FF$hexCode', radix: 16)); }