flutter-auth-ui icon indicating copy to clipboard operation
flutter-auth-ui copied to clipboard

BooleanMetaDataField unexpected behavior

Open EnriColombo opened this issue 5 months ago • 0 comments

Bug report

Describe the bug

Unexpected behavior of BooleanMetaDataField in case both 'value' and 'isRequired' parameters are set to 'true'.

To Reproduce

Inside a SupaEmailAuth widget introduce a BooleanMetaDataField, with both 'value' and 'isRequired' parameters set to 'true':

SupaEmailAuth(
  isInitiallySigningIn: false,
  // ...
  metadataFields: [
    BooleanMetaDataField(
      label: 'Sono un capitano',
      key: 'is_captain',
      checkboxPosition: ListTileControlAffinity.trailing,
      value: true,
      isRequired: true,
    ),
  ],
)

Initially submitting the form without interacting with the checkbox, the error 'This field is required' is displayed. You need to uncheck and re-check the checkbox to submit it correctly.

Expected behavior

I'd expect no interactions by the user at all if the checkbox is already checked and it's required.

Screenshots

Image

System information

  • OS: Android 11
  • Dart SDK version: 3.8.1 (stable) (Wed May 28 00:47:25 2025 -0700) on "linux_x64"
  • Flutter 3.32.1
  • DevTools 2.45.1
  • Version of supabase_flutter: 2.9.1
  • Version of supabase_auth_ui: 0.5.5

EnriColombo avatar Jul 02 '25 10:07 EnriColombo