{"id":32271091,"url":"https://github.com/eng-mahmoudbasuony/x_validators","last_synced_at":"2026-02-19T09:33:28.924Z","repository":{"id":214949047,"uuid":"737753009","full_name":"Eng-MahmoudBasuony/x_validators","owner":"Eng-MahmoudBasuony","description":"🚀 ☕ X Validators is a library that simplifies data validation in your applications. ☕🚀","archived":false,"fork":false,"pushed_at":"2024-05-29T07:11:02.000Z","size":162,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-05-29T19:57:59.443Z","etag":null,"topics":["dart","dart-package","flutter","flutter-package","validation","validation-error","validation-tool","x-validators"],"latest_commit_sha":null,"homepage":"https://pub.dev/packages/x_validators","language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Eng-MahmoudBasuony.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-01-01T11:16:52.000Z","updated_at":"2024-05-29T07:11:05.000Z","dependencies_parsed_at":"2024-01-26T13:09:04.565Z","dependency_job_id":"7e77f9a8-9f41-4c3a-9ce0-fdcf90b917c3","html_url":"https://github.com/Eng-MahmoudBasuony/x_validators","commit_stats":{"total_commits":50,"total_committers":2,"mean_commits":25.0,"dds":0.4,"last_synced_commit":"dcff9e3b5bc4845ea8db5c7b04e302a9fdf08d98"},"previous_names":["eng-mahmoudbasuony/x_validators"],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/Eng-MahmoudBasuony/x_validators","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Eng-MahmoudBasuony%2Fx_validators","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Eng-MahmoudBasuony%2Fx_validators/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Eng-MahmoudBasuony%2Fx_validators/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Eng-MahmoudBasuony%2Fx_validators/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Eng-MahmoudBasuony","download_url":"https://codeload.github.com/Eng-MahmoudBasuony/x_validators/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Eng-MahmoudBasuony%2Fx_validators/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29609524,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-19T06:47:36.664Z","status":"ssl_error","status_checked_at":"2026-02-19T06:45:47.551Z","response_time":117,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dart","dart-package","flutter","flutter-package","validation","validation-error","validation-tool","x-validators"],"created_at":"2025-10-22T22:45:38.799Z","updated_at":"2026-02-19T09:33:28.918Z","avatar_url":"https://github.com/Eng-MahmoudBasuony.png","language":"Dart","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Stand With Palestine](https://raw.githubusercontent.com/TheBSD/StandWithPalestine/main/banner-no-action.svg)](https://thebsd.github.io/StandWithPalestine)\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"#\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/Eng-MahmoudBasuony/x_validators/main/logo_x_validators.png\" width=350 height=auto /\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\n \n # ☕ X Validators \n![Pub](https://img.shields.io/pub/v/x_validators)\n![GitHub License](https://img.shields.io/github/license/Eng-MahmoudBasuony/x_validators)\n\nSimplest form validation for flutter form widgets.\n* Zero dependency\n* Extensible\n* Well tested\n* Open source\n    \n ## 🚀 Installation \n \nAdd the following to your `pubspec.yaml` file\n\n```yaml\ndependencies:\n   x_validators: ^1.0.7\n```\n\nDon't forget to `flutter pub get`.\n\n## Api Overview\n\n| Rules for `Text` | Description                                                                |\n|------------------|----------------------------------------------------------------------------|\n| `IsRequired()`   | Ensures that the trimmed input is not empty.                               |\n| `Contains()`     | Verifies if the input string contains the provided value.                  |\n| `EndsWith()`     | Ensures that the input string ends with a specific value.                  |\n| `IsEmpty()`      | Ensures that the trimmed input is empty.                                   |\n| `Match()`        | Verifies if the input matches the specified string.                        |\n| `MaxLength()`    | Ensures that the length is less than or equal to the specified maximum.    |\n| `MinLength()`    | Ensures that the length is greater than or equal to the specified minimum. |\n| `NotContains()`  | Verifies if the input string does not contain the provided value.          |\n| `StartsWith()`   | Ensures that the input string starts with a specific pattern.              |\n\n| Rules for `NUMBERS` | Description                                                                      |\n|---------------------|----------------------------------------------------------------------------------|\n| `IsArabicNum()`     | Verifies if the input is a valid Arabic integer.                                 |\n| `IsHindiNum()`      | Verifies if the input is a valid Hindi integer.                                  |\n| `IsNumber()`        | Verifies if the input is a valid integer.                                        |\n| `MaxValue()`        | Verifies if the numeric value is less than or equal to the specified maximum.    |\n| `MinValue()`        | Verifies if the numeric value is greater than or equal to the specified minimum. |\n\n| Rules for `URLS`   | Description                                                       |\n|--------------------|-------------------------------------------------------------------|\n| `IsFacebookUrl()`  | Verifies if the input is a valid Facebook URL.                    |\n| `IsInstagramUrl()` | Verifies if the input is a valid Instagram URL.                   |\n| `IsSecureUrl()`    | Verifies if the input is a secure URL (starts with `'https://'`). |\n| `IsUrl()`          | Verifies if the input is a valid URL.                             |\n| `IsYoutubeUrl()`   | Verifies if the input is a valid YouTube URL.                     |\n\n| Rules for `Phone`   | Description                                                  |\n|---------------------|--------------------------------------------------------------|\n| `IsEgyptianPhone()` | Verifies if the input is a valid Egyptian phone number.      |\n| `ISKsaPhone()`      | Verifies if the input is a valid Saudi Arabian phone number. |\n\n| Rules for `It`  | Description                                             |\n|-----------------|---------------------------------------------------------|\n| `IsEmail()`     | Verifies if the input is a valid email address.         |\n| `IsBool()`      | Verifies if the input is a valid boolean value.         |\n| `IsIpAddress()` | Verifies if the input is a valid IP address.            |\n| `IsPort()`      | Verifies if the input is a valid port number.           |\n| `RegExpRule()`  | Allows using a regular expression as a validation rule. |\n\n\n| Rules for `lists`  | Description                                                           |\n|--------------------|-----------------------------------------------------------------------|\n| `ContainsAny()`    | Checks if the input contains any string from the provided list.       |\n| `IsIn()`           | Checks if the input is in the provided list.                          |\n| `IsNotIn()`        | Checks if the input is not in the provided list.                      |\n| `NotContainsAny()` | Checks if the input does not contain any item from the provided list. |\n\n| Rules for `magic` | Description                                  |\n|-------------------|----------------------------------------------|\n| `IsOptional()`    | Allows skipping errors if the input is null. |\n\n| Rules for `colors` | Description                               |\n|--------------------|-------------------------------------------|\n| `IsHexColor()`     | Checks if the input is a valid hex color. |\n\n| Rules for `dates` | Description                                                              |\n|-------------------|--------------------------------------------------------------------------|\n| `IsDateAfter()`   | Checks if the date is after the specified date.                          |\n| `IsDate()`        | Checks if the input is a valid date format.                              |\n| `IsDateMillis()`  | Checks if the input is a valid date format for milliseconds since epoch. |\n\n| Rules for `languages` | Description                                             |\n|-----------------------|---------------------------------------------------------|\n| `IsArabicChars()`     | Checks if the input consists of Arabic characters.      |\n| `IsEnglishChars()`    | Checks if the input consists of English characters.     |\n| `IsLtrLanguage()`     | Checks if the language code represents an LTR language. |\n| `IsArabicChars()`     | Checks if the input consists of Arabic characters.      |\n| `IsNumbersOnly()`     | Checks if the input consists of numbers only.           |\n| `IsRTLLanguage()`     | Checks if the language code represents an RTL language. |\n\n## How to Use\n\n#### 📚Basic use\n  ##### Demonstrates basic usage of IsRequired validation rule to ensure that the input is not empty.\n```Dart\n  TextFormField(\n                decoration: const InputDecoration(labelText: 'IsRequired'),\n                validator: xValidator([\n                 \n                  IsRequired(),\n                ]),\n              ),\n```\n\n#### 📚onFailureCallBack \n  ##### Illustrates more complex validation with multiple rules (IsRequired, MinLength, MaxLength).\n  ##### The onFailureCallBack is triggered for any rule failure, logging the input and the failed rule for analysis.\n```Dart\nTextFormField(\n  decoration: const InputDecoration(labelText: 'IsRequired'),\n  validator: xValidator([\n    // Ensures that the input is not empty with a custom error message.\n    IsRequired(\"Field cannot be empty\"),\n\n    // Ensures that the input has a minimum length of 3 characters.\n    MinLength(3, \"Field must be at least 3 characters\"),\n\n    // Ensures that the input does not exceed a maximum length of 20 characters.\n    MaxLength(20, \"Field cannot exceed 20 characters\"),\n  ], onFailureCallBack: (String? input, List\u003cTextXValidationRule\u003e rules, TextXValidationRule failedRule) {\n    // Logs information about the failed validation for further analysis.\n    log(\"###### Validation failed for input #### : $input\");\n    log(\"#### Failed rule #### : $failedRule\");\n  }),\n),\n```\n##### Explanation:\nThe first example demonstrates basic usage of IsRequired validation rule. It ensures that the input is not empty.\nThe second example uses multiple rules (IsRequired, MinLength, MaxLength) for more complex validation. It also includes an \nonFailureCallBack to handle validation failures. If any rule fails, the callback is triggered, logging the input and the failed rule for further analysis.\n\n\n## License\n\nPlease see [**LICENSE**](https://github.com/Eng-MahmoudBasuony/x_validators/blob/main/LICENSE).\n\n\n## 👨🏻‍💻 Authors\n- [@Eng-MahmoudBasuony](https://github.com/Eng-MahmoudBasuony)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feng-mahmoudbasuony%2Fx_validators","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feng-mahmoudbasuony%2Fx_validators","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feng-mahmoudbasuony%2Fx_validators/lists"}