GitHub repositorypacifio/validated

validated

Ultimate dart / flutter string validators 💃💃

validated project cover
Stars
21
Forks
5
Last push (UTC)
Nov 24, 2021
Project status
Active

Original README

English project snapshot. Visit GitHub for the latest content.

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

  • [x] Ported validator.js to dart
  • [x] emoji validator
  • [x] supports dart 2+ versions
  • [x] tested for flutter
  • [x] added docs
  • [x] Null safety
Adib Mohsin GitHub avatar
GitHub author

Adib Mohsin ↗

high on vector spaces

@antarys-ai Dhaka , Bangladesh Official website ↗
LanguagesDart

Categories

Packages published by this repository

Dependencies used

Dependency list 1 items

  • testDevelopment^1.17.10

How do I choose a repository?

Start with your use case, compare repository activity, and check the original project before adopting it.

  1. Search by repository name, owner or description, then narrow the results by topic.
  2. Compare stars, forks and recent pushes. Stars show community interest, not a guarantee of quality.
  3. Read the README, license and issues on GitHub before using a project.

Sources and maintenance

“A repository is the most basic element of GitHub.”

GitHub Docs — About repositories ↗