isHexColor property

bool get isHexColor

Checks if the string is a valid hexadecimal color code.

Implementation

bool get isHexColor => regex(r'^#(?:[0-9a-fA-F]{3}){1,2}$');