CountryPickerUiField

constructor(initialValue: String, label: LbcTextSpec?, placeholder: LbcTextSpec?, id: String, savedStateHandle: SavedStateHandle, isFieldInError: (String?) -> UiFieldError?, uiFieldStyleData: UiFieldStyleData = DefaultUiFieldStyleData(), onValueChange: (String) -> Unit, readOnly: Boolean = false, enabled: Boolean = true, coroutineScope: CoroutineScope, countryPickerBottomSheetRenderer: CountryPickerBottomSheetRenderer, trailingIcon: @Composable () -> Unit? = null)

Parameters

initialValue

The initial ISO 3166-1 alpha-2 country code to be displayed.

label

The label for the text field, as a LbcTextSpec.

placeholder

The placeholder text to be displayed when the field is empty, as a LbcTextSpec.

id

A unique identifier for the field, used for state saving.

savedStateHandle

The SavedStateHandle used to persist the field's state across process death.

isFieldInError

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.

uiFieldStyleData

The styling data for the text field, implementing UiFieldStyleData. Defaults to DefaultUiFieldStyleData.

onValueChange

A callback that is invoked when the selected country changes. The new value is the country's ISO code.

readOnly

A boolean indicating whether the field is read-only. If true, the user cannot change the value.

enabled

A boolean indicating whether the field is enabled. If false, the field is disabled and does not respond to user input.

coroutineScope

The CoroutineScope used for managing background operations, such as country search.