How to get Context in Jetpack Compose

前端 未结 7 1657
情歌与酒
情歌与酒 2021-02-19 07:35
fun createListItem(itemIndex: Int) {
Padding(left = 8.dp, right = 8.dp, top = 8.dp, bottom = 8.dp) {
    FlexRow(crossAxisAlignment = CrossAxisAlignment.Center) {
               


        
7条回答
  •  攒了一身酷
    2021-02-19 07:39

    The way to do this has been updated. It's now:

    val context = ContextAmbient.current
    

    ContextAmbient docs

提交回复
热议问题