CountrySearchState

class CountrySearchState(val countriesToShow: List<String> = emptyList(), val countriesToExclude: List<String> = emptyList(), val pinnedCountries: List<String> = emptyList())(source)

State holder for country search and filtering inside the countries bottom sheet.

All derived lists (pinnedList, filteredCountries) recompute automatically via derivedStateOf — no coroutines or manual invalidation needed.

Parameters

countriesToShow

Whitelist of ISO codes to show. Empty = all countries.

countriesToExclude

Blacklist of ISO codes to hide regardless of countriesToShow.

pinnedCountries

ISO codes of countries pinned to a "Suggested" section at the top of the list. Only visible when query is blank.

Create via rememberCountrySearchState.

Constructors

Link copied to clipboard
constructor(countriesToShow: List<String> = emptyList(), countriesToExclude: List<String> = emptyList(), pinnedCountries: List<String> = emptyList())

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Grouped and filtered country list. When query is blank and pinnedCountries is set, pinned countries are excluded from this map to avoid duplication with pinnedList.

Link copied to clipboard
Link copied to clipboard

Countries pinned to the top "Suggested" section. Empty while the user is searching, so the pinned header disappears and the results are consolidated.

Link copied to clipboard

Functions

Link copied to clipboard
fun updateQuery(newQuery: String)