RequiredIf<T>.condition constructor

RequiredIf<T>.condition(
  1. bool condition()?, {
  2. String? message,
})

Creates a new instance of the RequiredIf validation rule based on a condition.

  • condition: The condition function that determines if the value is required (required).
  • message: A custom validation message (optional) to be displayed when the validation fails.

Implementation

RequiredIf.condition(this.condition, {String? message})
    : otherFieldName = null,
      equalTo = null,
      super(message);