isValid method

  1. @override
bool isValid()
override

Implementation

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