isRequired method
Expose whether the field should be required given the current form state.
Implementation
bool isRequired(Map<String, FormFieldState> fields) {
if (condition != null) return condition!();
if (otherFieldName != null) {
return fields[otherFieldName!]?.value == equalTo;
}
return false;
}