text_form_validator 1.0.6 copy "text_form_validator: ^1.0.6" to clipboard
text_form_validator: ^1.0.6 copied to clipboard

Provides a simple way to combine validation functions, failing and providing the most informative error to the user.

example/main.dart

import "package:flutter/material.dart";
import "package:text_form_validator/form_validator.dart";

/// A very simple example showing how to add a [FormValidator] to a [TextFormField]
void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return const MaterialApp(
      home: DemoPage(),
    );
  }
}

class DemoPage extends StatelessWidget {
  const DemoPage({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Scaffold(
        body: TextFormField(
      validator: FormValidator.required().build(),
    ));
  }
}
1
likes
160
points
47
downloads

Publisher

unverified uploader

Weekly Downloads

Provides a simple way to combine validation functions, failing and providing the most informative error to the user.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter, intl

More

Packages that depend on text_form_validator