parseColor static method

int parseColor(
  1. String color
)

Implementation

static int parseColor(String color) {
  try {
    color = color.toUpperCase().replaceAll("#", "");
    if (color.length == 6) {
      color = "FF" + color;
    }
  } on Exception catch (e) {
    return Colors.white.value;
  }
  return int.parse(color, radix: 16);
}