Skip to content

Instantly share code, notes, and snippets.

@arriolac
Created September 21, 2022 14:56
Show Gist options
  • Save arriolac/37311c38f5fbc4fbde6a112a99b15022 to your computer and use it in GitHub Desktop.
Save arriolac/37311c38f5fbc4fbde6a112a99b15022 to your computer and use it in GitHub Desktop.
// Copyright 2022 Google LLC.
// SPDX-License-Identifier: Apache-2.0
@Composable
fun SingleChoiceQuestion(answers: List<Answer>) {
var selectedAnswer: MutableState<Answer?> =
rememberSaveable { mutableStateOf(null) }
answers.forEach { answer ->
SurveyAnswer(
answer = answer,
isSelected = (selectedAnswer.value == answer),
)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment