AppContainer

fun AppContainer(modifier: Modifier = Modifier, isLoading: Boolean = false, error: AppErrorData? = null, onRetry: () -> Unit? = null, topBar: @Composable () -> Unit? = null, searchBar: @Composable () -> Unit? = null, chipGroup: @Composable () -> Unit? = null, drawerContent: @Composable ColumnScope.() -> Unit? = null, drawerState: DrawerState? = null, bottomBar: @Composable () -> Unit? = null, snackBarHostState: SnackbarHostState = remember { SnackbarHostState() }, scrollBehavior: TopAppBarScrollBehavior = TopAppBarDefaults.pinnedScrollBehavior(rememberTopAppBarState()), content: @Composable (Modifier) -> Unit)

A root container component that provides a common layout structure including a top bar, bottom bar, navigation drawer, and snackbar host. It automatically handles responsive drawer behavior (modal for small screens, permanent for large screens) and centralized loading/error states.

Parameters

modifier

The Modifier to be applied to the container.

isLoading

Displays a centered loading state if true.

error

Displays an error state if provided.

onRetry

Callback for the primary action in the error state.

topBar

Optional top app bar composable.

searchBar

Optional search bar composable.

chipGroup

Optional chip group composable.

drawerContent

Optional content for the navigation drawer.

drawerState

Optional state to control the drawer.

bottomBar

Optional bottom navigation bar composable.

snackBarHostState

The SnackbarHostState for managing snackbars.

scrollBehavior

The TopAppBarScrollBehavior to coordinate with the top bar.

content

The main content of the container, receiving a Modifier with appropriate padding and insets.