Skip to content

Pinput should expose FormField's autovalidateMode property #232

@AmmarAyman108

Description

@AmmarAyman108

Title: Add support for autovalidateMode

Description:

It would be great if Pinput supported Flutter's FormField autovalidateMode property.

Currently, validation messages are not always shown immediately when the field contains incomplete input unless focus is lost or FormState.validate() is called manually.

Expected behavior:

Pinput(
  autovalidateMode: AutovalidateMode.onUserInteraction,
  validator: (value) {
    if (value == null || value.length != 4) {
      return 'Invalid OTP';
    }
    return null;
  },
)

Benefits:

  • Consistent behavior with Flutter FormField widgets
  • Better UX for OTP validation
  • Less need for manual focus handling
  • Easier integration with existing forms

Thank you for the great package.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions