text_form_validator 1.0.4 copy "text_form_validator: ^1.0.4" to clipboard
text_form_validator: ^1.0.4 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.builder().required().build(),
    ));
  }
}
0
likes
140
pub points
28%
popularity

Publisher

unverified uploader

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