Search packages, repositories and app categories

Package detailsv1.3.2

validatorless

This package provides a means to validate text inputs on the flutter and was inspired by Yup

AndroidiOSWebmacOSWindowsLinux
30-day downloads
8.6K
Likes
171
Pub points
150

Install package

flutter pub add validatorless

Package Overview

Package selection guidance compiled from public package information, community data, and project usage.

Validatorless is a Flutter package designed to simplify text input validation, inspired by Yup. It offers a flexible and intuitive way to define validation rules for form fields, enabling developers to create robust input validation logic with minimal boilerplate. The package supports various validation types and can be easily integrated into Flutter applications across multiple platforms. It focuses on clean syntax and extensibility, making it ideal for forms requiring dynamic or complex validation workflows.

Use cases

  • Form input validation
  • Dynamic form validation
  • Custom validation rules
  • Cross-platform form handling
  • Real-time input feedback
  • Validation error messaging

Key features

  • Yup-inspired syntax
  • Extensible validation rules
  • Minimal boilerplate
  • Supports async validation
  • Platform-agnostic
  • Easy integration with TextFormField

Suitable for

  • Flutter developers building forms
  • Apps requiring real-time validation
  • Teams using Yup-like validation patterns
  • Projects needing lightweight validation
  • Developers seeking simple yet powerful validation

Considerations

  • Limited built-in validators compared to full frameworks
  • Requires manual setup for complex validation chains
  • No built-in localization support
  • Best suited for straightforward to moderately complex validation needs

Original README

Original README snapshot from the linked source repository. Visit the repository for the latest content.

Validatorless

Pub Version

This package provides a means to validate text inputs on the flutter and was inspired by Yup

Validatorless in pub.dev

how to use
dependencies:
  # Use the latest version available. Any is just a placeholder
  validatorless: any
TextFormField(
  decoration: InputDecoration(
    labelText: 'User e-mail',
  ),
  validator: Validatorless.multiple([
     Validatorless.email('The field must be an email'),
     Validatorless.required('The field is obligatory')
  ]),
)

or use

TextFormField(
  decoration: InputDecoration(
    labelText: 'CPF',
  ),
  validator: Validatorless.cpf('CPF not is valid'),
)
Validatorless options
  Validatorless.multiple(List<Validatorless>)
  Validatorless.required(String)
  Validatorless.email(String)
  Validatorless.min(int, String)
  Validatorless.max(int, String)
  Validatorless.between(int, int, String)
  Validatorless.number(String)
  Validatorless.cpf(String)
  Validatorless.cnpj(String)
  Validatorless.date(String)
  Validatorless.compare(TextEditingController, String)
  Validatorless.numbersBetweenInterval(Double, Double, String)
  Validatorless.onlyCharacters(String)
  Validatorless.regex(RegExp, String)
  Validatorless.length(int, String)
  Validatorless.phone(String) // (99) 99999-9999 or (99) 9999-9999
  Validatorless.cep(String)
  Validatorless.url(String)
  Validatorless.strongPassword(String, {int minLength})
  Validatorless.creditCard(String)
  Validatorless.placa(String)

Publishing

Pushes to master run .github/workflows/publish.yml: patch-bump pubspec.yaml (unless the push already changed the version), append CHANGELOG.md, commit with [skip ci], tag (1.3.1, no v prefix), create a GitHub Release, and dart pub publish --force.

Add a repository secret named PUB_CREDENTIALS_JSON (Settings → Secrets and variables → Actions) containing the full contents of the Dart credentials file after dart pub login:

  • Linux: ~/.pub-cache/credentials.json or ~/.config/dart/pub-credentials.json
  • macOS: ~/Library/Application Support/dart/pub-credentials.json

Do not commit that file. The workflow fails if the secret is missing.

Categories

Source repository

Projects using this package