validation method
dynamic
validation(
- dynamic inspectionCase,
- dynamic inspectionCaseRule, {
- dynamic myCustomRule(
- String,
- InspectionCase inspectionCase
inherited
Implementation
validation(inspectionCase, inspectionCaseRule,
{Function(String, InspectionCase inspectionCase)? myCustomRule}) {
inspectionCase.rule = inspectionCaseRule;
List rule = inspectionCaseRule.split(':');
String ruleString = rule[0];
if (myCustomRule != null) {
String customRulesOutput = myCustomRule(ruleString, inspectionCase);
if (customRulesOutput != null && customRulesOutput != '')
return customRulesOutput;
else
return checkRule(ruleString, inspectionCase);
} else
return checkRule(ruleString, inspectionCase);
}