FeatureFlipScreen

fun FeatureFlipScreen(modifier: Modifier = Modifier, bottomPadding: Dp = 0.dp)

Main screen for managing feature flags.

Displays a searchable, filterable list of feature flags with interactive controls to modify their state. The screen provides a comprehensive interface for managing both local and remote features during development and testing.

Features

  • Search: Filter features by name using the search bar

  • Filters: Filter by type (Local/Remote) and state (On/Off)

  • Local Features: Simple on/off switch control

  • Remote Features: Tri-state control (Remote/Off/On)

  • Persistent State: All changes are automatically saved using DataStore

  • Real-time Updates: UI updates immediately when feature states change

Usage

Basic Usage with FeatureHandler

val features = listOf(
Feature.LocalFeature(
name = "dark_mode",
description = "Enable dark theme",
isEnabled = false
),
Feature.RemoteFeature(
name = "new_feature",
description = "New experimental feature",
defaultRemoteValue = true,
state = FeatureState.REMOTE
)
)

val featureHandler = rememberFeatureHandler(features)
CompositionLocalProvider(LocalFeatureHandler provides featureHandler) {
FeatureFlipScreen()
}

Standalone Usage

Scaffold { paddingValues ->
FeatureFlipScreen(
modifier = Modifier
.fillMaxSize()
.padding(paddingValues)
)
}

UI Components

  • Search bar with clear button

  • Filter chips for Local/Remote/On/Off states

  • Grouped feature cards with adaptive shapes

  • Switches for local features

  • Tri-state segmented buttons for remote features

Parameters

modifier

Modifier to be applied to the root container.

See also

Throws

if LocalFeatureHandler is not provided in the composition.