rememberFilterState

fun rememberFilterState(filter: ConjunctionFilterScope.() -> Unit = {}, scanResultFilter: (ScanResult) -> Boolean = { it.isConnectable }, dynamicFilters: List<Filter> = listOf( OnlyNearby(), OnlyWithNames(isInitiallySelected = true), ), sortingOptions: List<SortingOption> = listOf( SortByRssi(), SortByName() )): ScanFilterState

Creates a ScanFilterState that can be used to manage the state of the scanner.

Parameters

filter

A static filter to be applied to all scan results. Defaults to an empty filter.

scanResultFilter

A filter to be applied to each scan result. Defaults to connectable devices.

dynamicFilters

The list of filters to be shown in the scanner. Defaults to a list containing OnlyNearby, OnlyWithNames.

sortingOptions

The list of sorting options to be shown in the scanner. Defaults to a list containing SortByRssi and SortByName. If the list is not empty, an option to clear the sorting will be added.