Fix the composable to be able run an application.
Hello, Compose!
Fix composables
Report a typo
Write a program in Kotlin
@Composable
fun ChatScreen(chatList: List<Chat>) {
HyperskillTheme {
chatList.forEach {
ShowLastMessage(it.unread, it.message)
}
}
}
@Composable
fun LastMessage(message: String) {
Text(text = "Last message: $message")
}
@Composable
fun LastUnreadMessage(message: String) {
Text(text = "Last unread message: $message")
}
fun ShowLastMessage(showUnread: Boolean, message: String) {
if (showUnread) {
LastUnreadMessage(message)
} else {
LastMessage(message)
}
}
___
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.
Create a free account to access the full topic
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.