Country Picker Ui Field
A UiField implementation for selecting a country from a list presented in a bottom sheet.
This field displays the selected country's name. When the user focuses on the field, a bottom sheet appears, allowing them to search for and select a country. The field's value is the ISO 3166-1 alpha-2 country code (e.g., "US", "FR").
It uses the hbb20.CountryCodePicker-Android library for country data.
Parameters
The initial ISO 3166-1 alpha-2 country code to be displayed.
The label for the text field, as a LbcTextSpec.
The placeholder text to be displayed when the field is empty, as a LbcTextSpec.
A unique identifier for the field, used for state saving.
The SavedStateHandle used to persist the field's state across process death.
A lambda function that determines if the current value is in an error state. It should return a UiFieldError if there is an error, or null otherwise.
The styling data for the text field, implementing UiFieldStyleData. Defaults to DefaultUiFieldStyleData.
A callback that is invoked when the selected country changes. The new value is the country's ISO code.
A boolean indicating whether the field is read-only. If true, the user cannot change the value.
A boolean indicating whether the field is enabled. If false, the field is disabled and does not respond to user input.
The CoroutineScope used for managing background operations, such as country search.