'Type mismatch. Required: Alignment.Horizontal Found: Alignment

Context

I'm trying to create a FloatingActionButton at the bottom right part of a screen that allows you to scroll back up to the top of the screen (It's a screen with a scrollable list)

Code

FloatingActionButton(backgroundColor = MaterialTheme.colors.primary,
                    modifier = Modifier
                        .align(Alignment.BottomEnd)
                        .navigationBarsPadding()
                        .padding(bottom = 8.dp),
                    onClick = { coroutineScope.launch { listState.scrollToItem(0) } }) {
                    Text(text = "Up!")
                }

I get an error on .align(Alignment.BottomEnd)

Type mismatch. Required: Alignment.Horizontal Found: Alignment

I get this means the .align method expects Alignment.Horizontal type but BottomEnd is of type Alignment. How do I solve this?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source