KomposeCountryCodePicker

fun KomposeCountryCodePicker(state: CountryCodePicker, text: String, modifier: Modifier = Modifier, onValueChange: (String) -> Unit = {}, error: Boolean = false, showOnlyCountryCodePicker: Boolean = false, shape: Shape = MaterialTheme.shapes.medium, placeholder: @Composable (defaultLang: String) -> Unit = { defaultLang -> DefaultPlaceholder(defaultLang) }, colors: TextFieldColors = TextFieldDefaults.colors(), trailingIcon: @Composable () -> Unit? = null, countrySelectionDialogContainerColor: Color = MaterialTheme.colorScheme.background, countrySelectionDialogContentColor: Color = MaterialTheme.colorScheme.onBackground, interactionSource: MutableInteractionSource = MutableInteractionSource(), selectedCountryFlagSize: FlagSize = FlagSize(28.dp, 18.dp), textStyle: TextStyle = LocalTextStyle.current, enabled: Boolean = true)

KomposeCountryCodePicker is a composable that displays a text field with a country code picker dialog.

Parameters

state

The state of the country code picker.

text

The text to be displayed in the text field.

modifier

Modifier to be applied to the layout.

onValueChange

Called when the value is changed.

error

If true, the text field will be displayed in the error state.

showOnlyCountryCodePicker

If true, only the country code picker will be displayed.

shape

The shape of the text field's outline.

placeholder

The placeholder to be displayed in the text field.

colors

The colors to be used to display the text field.

trailingIcon

The trailing icon to be displayed in the text field.

countrySelectionDialogContainerColor

The color to be used to display the country selection dialog container.

countrySelectionDialogContentColor

The color to be used to display the country selection dialog content. text.

interactionSource

The MutableInteractionSource representing the stream of Interactions for this text field.

selectedCountryFlagSize

The size of the selected country flag (width and height in .dp).

textStyle

The style to be used for displaying text on the TextField and the selected country.

enabled

Controls the enabled state of the text field.