tiny_forms 0.2.0+10 copy "tiny_forms: ^0.2.0+10" to clipboard
tiny_forms: ^0.2.0+10 copied to clipboard

TinyForms is a minimalistic Flutter package for building simple and lightweight forms with easy customization and validation.

Tiny Forms #

TinyForms is a minimalistic Flutter package for building simple and lightweight forms with easy customization and validation.

Installation 💻 #

Add tiny_forms to your pubspec.yaml:

dependencies:
  tiny_forms: ^0.1.0+6

Install it:

flutter packages get

Example #

class ExampleApp extends StatelessWidget {
  /// Example app for TinyForms
  ExampleApp({super.key});

  /// The [TinyFormClient] to use for the form.
  final formClient = TinyFormClient();

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        body: formClient.formProvider(
          child: Column(
            children: [
              TextFormField(
                controller: TextEditingController(),
              ).register(name: 'username'),
              // Validation using the form_validator package
              TextFormField(
                validator: ValidationBuilder().minLength(5).build(),
                controller: TextEditingController(),
              ).register(name: 'username'),
              ElevatedButton(
                onPressed: formClient.handleSubmit((data) {
                  debugPrint(data.toString());
                }),
                child: const Text('Submit'),
              ),
            ],
          ),
        ),
      ),
    );
  }
}
0
likes
150
pub points
0%
popularity

Publisher

unverified uploader

TinyForms is a minimalistic Flutter package for building simple and lightweight forms with easy customization and validation.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

equatable, flutter, flutter_bloc

More

Packages that depend on tiny_forms