GitHub 代码仓pacifio/validated

已验证

终极 dart / flutter 字符串验证器 💃💃

已验证 项目封面
星标
21
复刻
5
最近推送(UTC)
2021年11月24日
项目状态
未归档

原始 README

以下为英文项目原文快照,最新内容请访问 GitHub。

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 作者

Adib Mohsin ↗

high on vector spaces

@antarys-ai Dhaka , Bangladesh 官方网站 ↗
语言Dart

分类

此仓库发布的插件

使用的依赖

依赖清单 1 项

  • test开发依赖^1.17.10

如何选择适合项目的代码仓?

先按使用场景筛选,再比较项目活跃情况,最后到原始仓库核对使用要求。

  1. 通过仓库名、作者或描述搜索,再按技术分类缩小范围。
  2. 结合星标、复刻与最近推送比较项目;星标反映社区关注,不代表质量保证。
  3. 使用前在 GitHub 核对 README、许可证与 Issues。

来源与维护

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

GitHub Docs — About repositories ↗