isValid method

  1. @override
bool isValid()
override

Implementation

@override
bool isValid() {
  if (model.validateRegEx == null) {
    if (!(model.required ?? false)) {
      return true;
    } else {
      return controller!.text.isNotEmpty;
    }
  } else {
    return model.validateRegEx!.hasMatch(controller!.text);
  }
}