validasi 0.0.10 copy "validasi: ^0.0.10" to clipboard
validasi: ^0.0.10 copied to clipboard

An easy to use and flexible validation library for Dart and Flutter. Easily validate your forms input with built-in rules or create your own.

0.0.1 #

Initial release of Validasi library. This release includes the following features:

  • Built-in validators for common data types
  • Object and Array schema for complex data validation
  • Transformer to convert input value into desired format
  • Safe validation using tryParse and tryParseAsync method
  • Custom rule support

0.0.2 #

This release includes the following changes:

  • Update documentation: fix typo customAsync to custom, add validateAsync to Helpers section
  • Adjust validation(core): ensure rules are unique by using Map, so when rule registered more than once, the old one will be replaced
  • Adjust validator test (core): introduce should only register rule once test and adjust the rules from array to map
  • Update package description to meet dart package criteria
  • Update image in README.md to use absolute link

0.0.3 #

Minor release to update the following:

  • Expose FailFn, CustomRule, CustomCallback API

0.0.4 #

This release introduce GenericValidator, add some rules for Array Validation, and add some methods for Object Validation.

  • Add max, notContains, contains, and unique rule for ArrayValidator.
  • Add extend and without method for ObjectValidator.
  • Add new GenericValidator through Validasi.generic<T>(transformer) to help validate any type.

0.0.5 #

This release introduce breaking changes! It simplifies the FieldValidator and GroupValidator Helpers API from previously when used in flutter:

var group = GroupValidator({
    'example': Validasi.string()
})

TextFormField(
  validator: (v) => FieldValidator(Validasi.string()).validate(v, path: 'Custom Path'),
)

TextFormField(
    validator: (v) => group.validate('example', v)
)

To a more simpler API:

var group = GroupValidator({
    'example': Validasi.string()
})

TextFormField(
  validator: FieldValidator(Validasi.string(), path: 'Custom Path').validate,
)

TextFormField(
    validator: group.on('example', path: 'Custom Path').validate
)

This means the previous code is not longer valid and should be updated to the new API.

Affected methods:

  • FieldValidator.validate
  • GroupValidator.validate

0.0.6 #

What's Changed #

New Contributors #

Full Changelog: https://github.com/albetnov/validasi/compare/v0.0.5...v0.0.6

0.0.7 #

What's Changed #

  • feat(string/url): Enhance url validation adding checks for validating schema and host using UrlChecks enum
  • chore(docs): Add checks to url method in string.md documentation
  • chore(docs): Updated Quick Start guide in doc/quick-start.md to include Flutter example

Full Changelog: https://github.com/albetnov/validasi/compare/v0.0.6...v0.0.7

0.0.8 #

What's Changed #

  • rewrite most of GroupValidator code for better maintainability and readability
  • Renamed on method to using to improve clarity
  • Added extend method to allow extending the existing validator in group
  • New validateMap and validateMapAsync methods to validate a map of values against the group schema.

Breaking Changes #

  • on method in GroupValidator has been renamed to using. Update your code accordingly.
  • Invalid field will return ValidasiException("Field '$field' is not found in the schema"). Impacted method (validate, validateAsync)
  • Unset field will return ValidasiException("Field is not set. Use 'using' method to set the field."). Impacted method (validate, validateAsync)

Full Changelog: https://github.com/albetnov/validasi/compare/v0.0.7...v0.0.8

0.0.9 #

What's Changed #

  • Refactored using method to return GroupValidatorUsing instead of GroupValidator to improve DX and better isolation

Breaking Changes #

  • using method in GroupValidator now returns GroupValidatorUsing instead of GroupValidator. Update your code accordingly.
  • validate and validateAsync methods in GroupValidator is now removed. It could only be used in GroupValidatorUsing class.
// before
GroupValidator(...).validate(); // static check: OK
// after
**Full Changelog**: https://github.com/albetnov/validasi/compare/v0.0.7...v0.0.8
GroupValidator(...).using('field').validate(); // static check: OK
GroupValidator(...).validate(); // static check: ERROR

Full Changelog: https://github.com/albetnov/validasi/compare/v0.0.8...v0.0.9

0.0.10 #

What's Changed #

Full Changelog: https://github.com/albetnov/validasi/compare/v0.0.9...v0.0.10

1
likes
160
points
49
downloads

Publisher

verified publisheralbetnv.me

Weekly Downloads

An easy to use and flexible validation library for Dart and Flutter. Easily validate your forms input with built-in rules or create your own.

Homepage
Repository (GitHub)
View/report issues

Topics

#validation #form

Documentation

API reference

License

MIT (license)

Dependencies

email_validator, intl, meta

More

Packages that depend on validasi