Search packages, repositories and app categories

GitHub repositorySoSerious194/simple_form_validations

simple_form_validations

SoSerious194/simple_form_validations open-source repository details.

simple_form_validations project cover
Stars
1
Forks
0
Last push (UTC)
Feb 14, 2024
Project status
Active

Original README

English project snapshot. Visit GitHub for the latest content.

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 author

mr.SoSerious ↗

Tech Nerd | Blogger | Programmer;

Jetpur, GujaratOfficial website ↗
LanguagesDartC++CMakeHTMLSwiftCKotlinObjective-C

Packages published by this repository

Dependencies used

Dependency list 3 items

  • flutter{"sdk":"flutter"}
  • flutter_testDevelopment{"sdk":"flutter"}
  • flutter_lintsDevelopment^2.0.0

How do I choose a repository?

Start with your use case, compare repository activity, and check the original project before adopting it.

  1. Search by repository name, owner or description, then narrow the results by topic.
  2. Compare stars, forks and recent pushes. Stars show community interest, not a guarantee of quality.
  3. Read the README, license and issues on GitHub before using a project.

Sources and maintenance

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

GitHub Docs — About repositories ↗