Skip to content

Instantly share code, notes, and snippets.

@saqib-github-commits
Created August 21, 2023 08:14
Show Gist options
  • Save saqib-github-commits/a70e5ea4196c051996c31c0abdfe6d53 to your computer and use it in GitHub Desktop.
Save saqib-github-commits/a70e5ea4196c051996c31c0abdfe6d53 to your computer and use it in GitHub Desktop.
@Composable
fun CustomAppBar(drawerState: DrawerState?, title: String) {
val coroutineScope = rememberCoroutineScope()
CenterAlignedTopAppBar(
navigationIcon = {
if (drawerState != null) {
IconButton(onClick = {
coroutineScope.launch {
drawerState.open()
}
}) {
Icon(Icons.Filled.Menu, contentDescription = "")
}
}
},
title = { Text(text = title) }
)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment