isValid method

bool isValid()

isValid Check if value of the field is valid using validator or text.isNotEmpty

Implementation

bool isValid() {
  if (validator != null) {
    if (validator?.call(controller?.text) == null) {
      return true;
    } else {
      return false;
    }
  } else {
    return controller?.text.isNotEmpty ?? false;
  }
}