Skip to content

v0.0.5

Latest
Compare
Choose a tag to compare
@albetnov albetnov released this 25 Feb 16:58
4daa530

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