Part of Queen Palace 🏰👑

style: lint

Palace Validators


  • the palace need to validate the request body throw some rules with easy clean and readable way
  • inspired from class-validators we built this package to fix this problem


  • helper function List<String> validateDto(OBject o) which validate a DTO based on decorations from queen_validators package
  • provider validation rules from queen_validators package


class GoodDto {
  final String name = 'queen';

  final String address = 'kingdom palace';

  final String email = 'queen@royal.kingdom';

 final failedRules = validateDto(GoodDto());
     // * the dto passed the validation successfully
     // * the dto has one or more failed rules
     // the result will be formatted like this in case  of any failed rules
     /// '`$fieldName ${rule.errorMsg}'`
     /// email failure
     /// '`email is not valid email address'`


the palace core package will be responsible for instantiates the Dto form req body example

final SignInDto dtoInstance = buildDto<SignInDto>({'email':'queen@Royal.kingdom'});
print(dtoInstance is SignInDto) // true
print(dtoInstance.email) // queen@Royal.kingdom


The Palace-Validators is open-sourced software licensed under the MIT license.