Search code snippets, questions, articles...

Convert HexColor to Flutter color

Color colorConvert(String color) {
  color = color.replaceAll("#", "");
  if (color.length == 6) {
    return Color(int.parse("0xFF" + color));
  } else if (color.length == 8) {
    return Color(int.parse("0x" + color));
  }
}
Best JSON Validator, JSON Tree Viewer, JSON Beautifier at same place.
    Was this helpful?
    0 Comments