isValid method

  1. @override
bool isValid(
  1. dynamic value
)
override

Implementation

@override
bool isValid(dynamic value) {
  if (value is String &&
      RegExp(r'^([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$').hasMatch(value)) {
    return true;
  }
  return false;
}