validated 2.0.0 copy "validated: ^2.0.0" to clipboard
validated: ^2.0.0 copied to clipboard

The ultimate string validator for dart and flutter with over 40+ validators

Validated #

Build Status The ultimate dart + flutter string validators . This library 45 validators plus sanitizers . Check out the docs for all functions . You will find all the functions under validated package

Example #

Validators #

Example of some validators .. go to lib/src/ to get the full list of validators or check out the docs for more info

import 'package:validated/validated.dart' as validate;

void main() {
  print(validate.isBoolean('a')); // false
  print(validate.isEmail("adib@gmail.com")); // true
  print(validate.isAscii("ABCDEF")); // false
  print(validate.isSameType('String', false)); // false
  print(validate.isUpperCase("ABCD")); // true
  print(validate.isCapitalized("Abcs")); // true
  print(validate.contains("Dart is nice", "nice")); // true
  print(validate.isCurrency("\$")); // false
  print(validate.isURL('https://www.google.com')); // true
  print(validate.isEmoji("😀")); // true
  print(validate.isEmoji("some random text")); // false
}

Sanitizers #

Example of some sanitizers

Credit

import 'package:validated/validated.dart' as validate;

validate.toBoolean(str);
validate.toDate(str);
validate.toDouble(str);
validate.toFloat(str);
validate.toInt(str);
validate.toString(input);

Credits #

1 . validator.js
2 . dart-validator
3 . email-validator
4. emoji-regex

TODO #

  • ✅ Ported validator.js to dart
  • ✅ emoji validator
  • ✅ supports dart 2+ versions
  • ✅ tested for flutter
  • ✅ added docs
  • ✅ Null safety
22
likes
140
points
3.44k
downloads

Publisher

unverified uploader

Weekly Downloads

The ultimate string validator for dart and flutter with over 40+ validators

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-2-Clause (license)

More

Packages that depend on validated