requiredIf<T> static method

ValidationRule<T> requiredIf<T>(
  1. String? otherFieldName, {
  2. dynamic equalTo,
  3. String? message,
})

Creates a RequiredIf validation rule.

This rule checks if a value is required based on a condition where the value of another field is equal to equalTo. It can include a custom validation message.

Implementation

static ValidationRule<T> requiredIf<T>(String? otherFieldName,
        {dynamic equalTo, String? message}) =>
    RequiredIf<T>(otherFieldName, equalTo: equalTo, message: message);