I'm having multiple-choice questions in which I have to select multiple answers, for that, I'm using CheckBoxListTile, i'm able to add the selected values in a single list but i want to add selected values in a different list as selected values of question 1 in a different list and question 2 in different
Asked
Active
Viewed 402 times
0
-
Please take a look at the question guidelines to improve your question: https://stackoverflow.com/help/how-to-ask – J. S. Sep 14 '20 at 14:21
1 Answers
2
For that, I think you would need to create lists for different questions.
For example:
//Create your lists to store the answers in for your questions
List<bool> question1Value = [];
List<bool> question2Value = [];
CheckBoxListTile(
title: Text("hello");
onChanged(bool value) {
// You can manipulate the data here in OnChanged
question1Value.add(value);
question2Value.add(value);
}
);
I hope this helped

CuteLizard420
- 72
- 5
-
i was following this approach https://stackoverflow.com/a/52867589/10326315, here he is creating a single list for the selected category what I want is to create different list for all the questions? can you help me with this? – VANSH BHASIN Sep 14 '20 at 15:53