I am developing basic flutter app. The app was working fine as long as I have changed the list of questions to the key and object pairs of questions and possible answers…..Can someone please guide me how to fix it?
I have tried giving the key of the question but still the error exists.
2
Answers
I think type cast will solve your problem.
or
Declare questions like this
List<Map<String, dynamic>> questions =
instead of
var questions =
Access a question like this
questions[_questionIndex]['question'] as String