Skip to content

How to disable/readonly ReactivePhoneFormField? #175

@hashirshoaeb

Description

@hashirshoaeb

here is my code: but i'm unable to find "readOnly" property to set

        ReactivePhoneFormField<String>(
          key: ValueKey(controlName),
          formControlName: controlName.name,
          validationMessages: validationMessages,
          inputFormatters: inputFormatters,
          decoration: decoration ??
              InputDecoration(
                hintText: hint?.tr(),
                enabled: false, //!readOnly,
              ),
          countrySelectorNavigator: CountrySelectorNavigator.modalBottomSheet(
            height: 300.h,
            countries: [
              ...allowedCountryCodes.keys,
            ],
          ),
          isCountryButtonPersistent: true,
          isCountrySelectionEnabled: false,
          valueAccessor: CountryPhoneValueAccessor(),
          style: context.theme.textTheme.bodyLarge,
          countryButtonStyle: CountryButtonStyle(
            textStyle: context.theme.textTheme.bodyLarge,
          ),
          autofillHints: [AutofillHints.telephoneNumber],
        ),

Whereas the parent library has that, "enabled" property.
https://pub.dev/documentation/phone_form_field/latest/phone_number_input/PhoneFormField-class.html

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions