required static method

PhoneNumberInputValidator required(
  1. BuildContext context, {
  2. String? errorText,
})

Implementation

static PhoneNumberInputValidator required(
  BuildContext context, {
  /// custom error message
  String? errorText,
}) {
  return (PhoneNumber? valueCandidate) {
    if (valueCandidate == null || (valueCandidate.nsn.trim().isEmpty)) {
      return errorText ??
          PhoneFieldLocalization.of(context).requiredPhoneNumber;
    }
    return null;
  };
}