wc_form_validators 1.0.1 copy "wc_form_validators: ^1.0.1" to clipboard
wc_form_validators: ^1.0.1 copied to clipboard

A Flutter plugin to validate forms with utility functions. It can validate emails, regex, character limits and many more.

example/lib/main.dart

import 'package:flutter/material.dart';

import 'required_validation_container.dart';
import 'min_validation_container.dart';
import 'max_validation_container.dart';
import 'email_validation_container.dart';
import 'min_length_validation_container.dart';
import 'max_length_validation_container.dart';
import 'pattern_validation_container.dart';
import 'compose_validation_container.dart';

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      theme: ThemeData(
        primarySwatch: Colors.blue,
        inputDecorationTheme: InputDecorationTheme(
          border: OutlineInputBorder(),
        ),
        buttonTheme: ButtonThemeData(
          textTheme: ButtonTextTheme.primary,
        ),
      ),
      home: Scaffold(
        appBar: AppBar(
          title: Text('Form Validtors Example'),
        ),
        body: _Body(),
      ),
    );
  }
}

class _Body extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return ListView(
      padding: EdgeInsets.symmetric(
        horizontal: 16,
        vertical: 8,
      ),
      children: <Widget>[
        SizedBox(height: 8),
        RequiredValidationContainer(),
        SizedBox(height: 8),
        Divider(),
        SizedBox(height: 8),
        MinValidationContainer(),
        SizedBox(height: 8),
        Divider(),
        SizedBox(height: 8),
        MaxValidationContainer(),
        SizedBox(height: 8),
        Divider(),
        SizedBox(height: 8),
        EmailValidationContainer(),
        SizedBox(height: 8),
        Divider(),
        SizedBox(height: 8),
        MinLengthValidationContainer(),
        SizedBox(height: 8),
        Divider(),
        SizedBox(height: 8),
        MaxLengthValidationContainer(),
        SizedBox(height: 8),
        Divider(),
        SizedBox(height: 8),
        PatternValidationContainer(),
        SizedBox(height: 8),
        Divider(),
        SizedBox(height: 8),
        ComposeValidationContainer(),
      ],
    );
  }
}
38
likes
150
pub points
90%
popularity

Publisher

verified publisherwisecrab.com

A Flutter plugin to validate forms with utility functions. It can validate emails, regex, character limits and many more.

Repository (GitHub)
View/report issues

Documentation

API reference

License

Apache-2.0 (license)

Dependencies

flutter

More

Packages that depend on wc_form_validators