uniform 1.0.2 copy "uniform: ^1.0.2" to clipboard
uniform: ^1.0.2 copied to clipboard

A form library for Flutter that handles form validation and state management gracefully, with unified form representation.

BSD-3 License Website Connect with Acme Software on Linkedin Twitter Follow Facebook Instagram

A form library for Flutter that handles form validation and state management gracefully,
with unified form representation.


Uniform handles the repetitive and annoying stuff—keeping track of values/errors/visited fields, orchestrating validation, and handling submission.

Features #

  • Unified form representation using controllers.
  • Easy and customizable form validation API.
  • Built-in support for form submission and state management.
  • Builders for quickly creating form fields.
  • Compatible with any state management solution or vanilla Flutter States.
  • Supports for global and local validators.

Getting started #

See the Installing section. No extra configurations needed.

Usage #

Note: Detailed Usage documentation is coming soon. For now, please refer to the example for more details.

InputForm(
  child: Column(
    children: [
      TextInputFieldBuilder(
        tag: 'email',
        builder: (_, controller, textController) {
          return TextFormField(
            controller: textController,
            decoration: InputDecoration(
              hintText: 'Email Address',
              errorText: controller.error.message,
            ),
            enabled: !controller.isSubmitted,
            onChanged: controller.onChanged,
          );
        },
      ),
      const SizedBox(height: 16),
      InputFieldBuilder<bool>(
        tag: 'remember_me',
        initialValue: false,
        builder: (context, controller, _) {
          return CheckboxListTile(
            title: const Text('Remember Me'),
            value: controller.value,
            controlAffinity: ListTileControlAffinity.leading,
            enabled: !controller.isSubmitted,
            onChanged: controller.onChanged,
          );
        },
      ),
      const SizedBox(height: 40),
      FilledButton(
        onPressed: () {
          if(InputForm.controllerOf(context).validate()){
            print('Form Submitted!');
          }
        },
        child: const Text('Submit'),
      ),
    ],
  ),
),

Recommendation #

The package works best in combination with clean_framework.

10
likes
0
pub points
61%
popularity

Publisher

verified publisheracmesoftware.com

A form library for Flutter that handles form validation and state management gracefully, with unified form representation.

Homepage
Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter

More

Packages that depend on uniform