搜尋套件、儲存庫與 APP 分類

GitHub 儲存庫SoSerious194/simple_form_validations

simple_form_validations

SoSerious194/simple_form_validations open-source repository details.

simple_form_validations 專案封面
星標
1
分支
0
最近推送(UTC)
2024年2月14日
專案狀態
未封存

原始 README

以下為英文專案原文快照,最新內容請造訪 GitHub。

simple_form_validations

Simple Validations is a Dart package that provides a collection of validators for common data validation scenarios. It simplifies the process of validating user input in forms, making it easy to ensure that data entered by users meets specific criteria.

Usage

To use this plugin, add simple_form_validations as a dependency in your pubspec.yaml file.

Example
class HomePage extends StatelessWidget {
  const HomePage({super.key});

  @override
  Widget build(BuildContext context) {
    final formKey = GlobalKey<FormState>();

    return Scaffold(
      body: SafeArea(
        child: Container(
          padding: const EdgeInsetsDirectional.all(22),
          child: Form(
            key: formKey,
            child: Column(
              children: [
                TextFormField(
                  validator: (value) =>
                      SimpleValidations.usernameOrEmailValidator(value),
                  decoration: const InputDecoration(
                    hintText: 'Validator Demo',
                    enabledBorder: OutlineInputBorder(),
                    focusedBorder: OutlineInputBorder(),
                    border: OutlineInputBorder(),
                  ),
                ),
                const SizedBox(height: 22),
                TextFormField(
                  validator: (value) =>
                      SimpleValidations.passwordValidator(value),
                  decoration: const InputDecoration(
                    hintText: 'Strong Password Validator Demo',
                    enabledBorder: OutlineInputBorder(),
                    focusedBorder: OutlineInputBorder(),
                    border: OutlineInputBorder(),
                  ),
                ),
                const SizedBox(height: 22),
                ElevatedButton(
                  onPressed: () {
                    if (formKey.currentState!.validate()) {
                      print("Valid data!");
                    }
                  },
                  child: const Text('Submit'),
                ),
              ],
            ),
          ),
        ),
      ),
    );
  }
}
Available Validators

The following validators are available in the package:

  • emptyFieldValidator
  • bankIfscValidator
  • alphaCharactersValidator
  • alphaCharactersWithSpaceValidator
  • alphaNumericCharactersValidator
  • alphaNumericCharactersWithSpaceValidator
  • numericValidator
  • numericWithSpaceValidator
  • passportValidator
  • panCardValidator
  • aadhaarValidator
  • vidValidator
  • voterIdValidator
  • socialSecurityValidator
  • emailValidator
  • phoneNumberValidator
  • urlValidator
  • decimalValidator
  • passwordValidator
  • usernameValidator
  • fileExtensionValidator
  • ipAddressValidator
  • hexColorValidator
  • creditCardValidator
  • jsonValidator
  • uuidValidator
  • isbnValidator
  • currencyValidator
  • macAddressValidator
  • htmlTagValidator
  • imeiValidator
  • ageValidator
  • postalCodeValidator
  • bankAccountNumberValidator
  • nameValidator
  • usernameOrEmailValidator
  • isbn13Validator
  • imei15Validator
  • uuidV4Validator
  • postalAddressValidator
  • cvvValidator
  • ipv6Validator
  • latitudeValidator
  • longitudeValidator
  • usernameOrDisplayNameValidator
  • emojiValidator
  • slugValidator

Issues and Feedback

Please feel free to report any issues or bugs you encounter. Your feedback and suggestions are highly appreciated and will help to improve this package.

mr.SoSerious GitHub avatar
GitHub 作者

mr.SoSerious ↗

Tech Nerd | Blogger | Programmer;

Jetpur, Gujarat官方網站 ↗
語言DartC++CMakeHTMLSwiftCKotlinObjective-C

此儲存庫發佈的套件

使用的依賴

依賴清單 3 項

  • flutter{"sdk":"flutter"}
  • flutter_test開發依賴{"sdk":"flutter"}
  • flutter_lints開發依賴^2.0.0

如何選擇適合專案的儲存庫?

先依使用情境篩選,再比較專案活躍情況,最後到原始儲存庫確認使用要求。

  1. 透過儲存庫名稱、作者或描述搜尋,再依技術分類縮小範圍。
  2. 綜合星標、分支與最近推送比較專案;星標反映社群關注,不保證品質。
  3. 使用前在 GitHub 確認 README、授權條款與 Issues。

來源與維護

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

GitHub Docs — About repositories ↗