Skip to content

Commit

Permalink
#7 - rememberCoroutineScope
Browse files Browse the repository at this point in the history
  • Loading branch information
jhg3410 committed Feb 20, 2023
1 parent bda57a3 commit bf2c524
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.lifecycle.viewmodel.compose.viewModel
import com.google.accompanist.insets.statusBarsPadding
import kotlinx.coroutines.launch

typealias OnExploreItemClicked = (ExploreModel) -> Unit

Expand All @@ -53,12 +54,15 @@ fun CraneHome(
CraneDrawer()
}
) { padding ->
val scope = rememberCoroutineScope()
CraneHomeContent(
modifier = modifier.padding(padding),
onExploreItemClicked = onExploreItemClicked,
openDrawer = {
// TODO Codelab: rememberCoroutineScope step - open the navigation drawer
// scaffoldState.drawerState.open()
scope.launch {
scaffoldState.drawerState.open()
}
}
)
}
Expand Down

0 comments on commit bf2c524

Please sign in to comment.