validasi 0.0.10
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
tryParseandtryParseAsyncmethod - Custom rule support
0.0.2 #
This release includes the following changes:
- Update documentation: fix typo
customAsynctocustom, addvalidateAsyncto 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 oncetest and adjust therulesfrom array to map - Update package description to meet dart package criteria
- Update image in
README.mdto use absolute link
0.0.3 #
Minor release to update the following:
- Expose
FailFn,CustomRule,CustomCallbackAPI
0.0.4 #
This release introduce GenericValidator, add some rules for Array Validation, and add some methods for Object Validation.
- Add
max,notContains,contains, anduniquerule forArrayValidator. - Add
extendandwithoutmethod forObjectValidator. - Add new
GenericValidatorthroughValidasi.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.validateGroupValidator.validate
0.0.6 #
What's Changed #
- chore(deps): bump intl from 0.19.0 to 0.20.2 by @dependabot in https://github.com/albetnov/validasi/pull/4
- chore(deps): bump lints from 4.0.0 to 5.1.1 by @dependabot in https://github.com/albetnov/validasi/pull/5
New Contributors #
- @dependabot made their first contribution in https://github.com/albetnov/validasi/pull/4
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
checksfor validatingschemaandhostusingUrlChecksenum - chore(docs): Add
checkstourlmethod instring.mddocumentation - chore(docs): Updated Quick Start guide in
doc/quick-start.mdto 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
onmethod tousingto improve clarity - Added
extendmethod to allow extending the existing validator in group - New
validateMapandvalidateMapAsyncmethods to validate a map of values against the group schema.
Breaking Changes #
onmethod inGroupValidatorhas been renamed tousing. 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
usingmethod to returnGroupValidatorUsinginstead ofGroupValidatorto improve DX and better isolation
Breaking Changes #
usingmethod inGroupValidatornow returnsGroupValidatorUsinginstead ofGroupValidator. Update your code accordingly.validateandvalidateAsyncmethods inGroupValidatoris now removed. It could only be used inGroupValidatorUsingclass.
// 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 #
- chore(deps): bump lints from 5.1.1 to 6.0.0 by @dependabot[bot] in https://github.com/albetnov/validasi/pull/7
- refactor: change return type of nullable, custom, and customFor metho… by @albetnov in https://github.com/albetnov/validasi/pull/8
- chore: bump version to 0.0.10 by @albetnov in https://github.com/albetnov/validasi/pull/9
Full Changelog: https://github.com/albetnov/validasi/compare/v0.0.9...v0.0.10