パッケージ、リポジトリ、アプリカテゴリを検索

パッケージ詳細v1.3.2

validatorless

このパッケージは、Flutterでテキスト入力を検証する手段を提供しており、Yupにインスパイアされています。

AndroidiOSWebmacOSWindowsLinux
30日間ダウンロード
8620
いいね数
171
Pub ポイント
150

パッケージをインストール

flutter pub add validatorless

パッケージ概要

公開情報に基づく選定ガイドです。参考としてご利用ください。

Validatorless は、Yup にインスパイアされた Flutter パッケージで、テキスト入力の検証を簡素化することを目的としています。フォームフィールドの検証ルールを柔軟かつ直感的に定義する方法を提供し、開発者が最小限のボイラープレートで堅牢な入力検証ロジックを作成できるようにします。このパッケージはさまざまな検証タイプをサポートしており、複数のプラットフォームでの Flutter アプリケーションへの容易な統合が可能です。明確な構文と拡張性に重点を置き、動的または複雑な検証ワークフローが必要なフォームに最適です。

用途

  • フォーム入力検証
  • 動的フォーム検証
  • カスタム検証ルール
  • クロスプラットフォームフォーム処理
  • リアルタイム入力フィードバック
  • 検証エラーメッセージ

主な機能

  • Yup を意識した構文
  • 拡張可能な検証ルール
  • 最小限のボイラープレート
  • 非同期検証をサポートしています
  • Platform-agnostic
  • TextFormField との簡単な統合

適している対象

  • Flutter開発者がフォームを構築しています
  • リアルタイム検証を必要とするアプリ
  • Yup風の検証パターンを使用するチーム
  • 軽量な検証が必要なプロジェクト
  • シンプルだが強力な検証を求める開発者

注意事項

  • 完全なフレームワークと比較して、組み込みのバリデータが限られている
  • 複雑な検証チェーンには手動設定が必要です
  • 組み込みのローカライゼーションサポートなし
  • 単純から中程度の複雑さの検証要件に最適

元の README

関連するソースリポジトリの README 原文のスナップショットです。最新の内容はリポジトリをご覧ください。

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.

カテゴリー

ソースリポジトリ

このパッケージを使用しているプロジェクト