CountrySelectionDialog

fun CountrySelectionDialog(countryList: List<Country>, containerColor: Color, contentColor: Color, onDismissRequest: () -> Unit, onSelect: (item: Country) -> Unit, modifier: Modifier = Modifier, properties: DialogProperties = DialogProperties( usePlatformDefaultWidth = false, ), title: @Composable () -> Unit = { Text( modifier = Modifier .offset(y = (-2).dp) .qaAutomationTestTag("countryDialogTitle"), text = stringResource(Res.string.select_country), style = MaterialTheme.typography.titleMedium, color = contentColor, ) }, backIcon: @Composable () -> Unit = { Icon( painter = painterResource(Res.drawable.ic_arrow_back), contentDescription = "Back", tint = contentColor, ) }, searchIcon: @Composable () -> Unit = { Icon( painter = painterResource(Res.drawable.ic_search), contentDescription = "Search", tint = contentColor, ) })

CountrySelectionDialog is a composable that displays a dialog for selecting a country.

All lambda and composable parameters are invoked synchronously on the main thread during composition. Exceptions thrown inside these lambdas will propagate to the caller and may crash the composition.

Parameters

countryList

The list of countries to be displayed in the dialog.

containerColor

The color of the dialog container.

contentColor

The color of the dialog content.

onDismissRequest

Called on the main thread when the user requests to dismiss the dialog (e.g. back press, outside tap). Exceptions thrown in this lambda will propagate to the caller.

onSelect

Called on the main thread when a country is selected. The selected Country is passed as a parameter. Exceptions thrown in this lambda will propagate to the caller.

modifier

Modifier to be applied to the layout.

properties

The properties of the dialog.

title

A composable lambda to display the title of the dialog.

backIcon

A composable lambda to display the back icon in the top app bar.

searchIcon

A composable lambda to display the search icon in the top app bar.