validate method

Future<bool> validate()

Implementation

Future<bool> validate() async {
  await loadRelations();

  Map<String, List<String>> validators = onValidate();

  validators['id'] = [
    'required',
  ];

  for (String key in validators.keys) {
    if (!Validator.validate(getData(key: key), validators[key]!)) {
      return false;
    }
  }

  Map<String, List<dynamic>> functionValidators = onValidateFunctions();

  for (String key in functionValidators.keys) {
    if (!Validator.validateFunction(functionValidators[key]!)) {
      return false;
    }
  }

  return true;
}