text_field_validator 0.0.9 copy "text_field_validator: ^0.0.9" to clipboard
text_field_validator: ^0.0.9 copied to clipboard

A flutter package for both Android and iOS which provides the validation functionalities for the input fields.

A flutter package for both Android and iOS which provides the validation functionalities for the input fields.

Features #

Provides validation for the input types 1. text 2. password 3. email 4. phone 5. url

Getting started #

Add the text_field_validator package into pubspec.yaml file start working. import the package as import 'package:text_field_validator/text_field_validator.dart';

Usage #

import 'package:text_field_validator/text_field_validator.dart';

class ValidatorTest extends StatefulWidget {
    const ValidatorTest({Key? key}) : super(key: key);

    @override
    State<ValidatorTest> createState() => _ValidatorTestState();
}

class _ValidatorTestState extends State<ValidatorTest> {
    @override
    Widget build(BuildContext context) {
        return Scaffold(
            appBar: AppBar(),
            body: Container(
                padding: const EdgeInsets.symmetric(horizontal: 16),
                child: Center(
                    child: Column(
                        children: [
                            TextFormField(
                                validator: (value) {
                                    return TextFieldValidator.textValidator(
                                        value: value,
                                    );
                                },
                            ),
                            const SizedBox(height: 20),
                            TextFormField(
                                validator: (value) {
                                    return TextFieldValidator.passWordValidator(
                                        password: value,
                                    );
                                },
                            ),
                        ],
                    ),
                ),
            ),
        );
    }
}
0
likes
150
points
51
downloads

Publisher

unverified uploader

Weekly Downloads

A flutter package for both Android and iOS which provides the validation functionalities for the input fields.

Repository (GitHub)

Documentation

API reference

License

BSL-1.0 (license)

Dependencies

flutter

More

Packages that depend on text_field_validator