former_gen 0.2.1 copy "former_gen: ^0.2.1" to clipboard
former_gen: ^0.2.1 copied to clipboard

Code generation for former.

former_gen #

Code generation for former.

Usage #

  1. Make sure build_runner is installed.
  2. Annotate your form class with @Formable
  3. Add part '<file-name>.g.dart'; before your class declaration
  4. Add class YourForm = _YourForm with _$YourFormIndexable;
  5. Run flutter pub get build_runner build
  6. A .g.dart file should be generated next to the file that contains your form class.

What's generated #

  • A mixin that makes your form class "indexable" with the bracket operator.
  • An enum class that includes all the fields of your form. They are used when you need to specify what field a particular Former widget should control.
  • A schema class that you should create when using the Former widget. Use it to describe the requirements of your form, using either the built-in validators or create your own by implementing Validator class.
0
likes
130
pub points
0%
popularity

Publisher

unverified uploader

Code generation for former.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

analyzer, build, source_gen

More

Packages that depend on former_gen