validHexColor static method

bool validHexColor(
  1. String value
)

Implementation

static bool validHexColor(String value) {
  final bool = RegExp(r'^#?([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$');
  if (bool.hasMatch("value")) {
    return true;
  } else {
    return false;
  }
}