CountryPickerSheet

fun CountryPickerSheet(state: CountryPickerState, onDismiss: () -> Unit, modifier: Modifier = Modifier, onCountrySelected: (Country) -> Unit = {}, onSelectionConfirmed: (Set<Country>) -> Unit = {}, recentCountryStore: RecentCountryStore = NoOpRecentCountryStore, title: UiText = UiText.resource(Res.string.ccp_select_country), subtitle: UiText? = UiText.resource(Res.string.ccp_select_country_subtitle), style: CountryPickerStyle = CountryPickerTheme.style, flagContent: @Composable (Country) -> Unit? = null, listItemContent: @Composable (CountryListItemScope) -> Unit? = null, emptyContent: @Composable (String) -> Unit? = null)(source)

The country picker, presented over the current screen.

How it is presented follows the style's com.ezzy.ccp.countrypicker.theme.CountryPickerLayout.presentation: by default a bottom sheet on phones and a centered dialog once the window is wide enough to make a sheet look stranded — tablets, foldables, desktop. The content is the same CountryPickerPanel either way.

Single vs. multiple selection

In single selection a tap commits immediately and — per com.ezzy.ccp.countrypicker.state.CountryPickerConfig.closeOnSingleSelection — the picker closes a beat later, so the check mark visibly lands first. In multiple selection a confirmation bar appears, and nothing reaches the caller until Confirm.

Reusable on its own: a host that wants the picker without a CountrySelector field can call this with its own CountryPickerState.

Parameters

onCountrySelected

Single-selection commit.

onSelectionConfirmed

Multiple-selection commit, from Confirm only.

onDismiss

Close, back, scrim tap or drag down. Pending changes are discarded.