I am trying to pass the following anonymous method but I get a lot of exceptions

  android, anonymous, dart, flutter, methods
Quiz(
 {@required this.questionIndex,
      @required this.answerQuestion,
      @required this.questions});

  @override
  Widget build(BuildContext context) {
    return Column(
      children: [
        Question(
        questions[questionIndex]['questiontext'],
        ),
        ...(questions[questionIndex]['answers'] as List<Map<String, Object>>)
         .map((answer) {
          return Answer(() => answerQuestion(answer['score']), answer['text']);
        }).toList()
      ],
    );
  }
}

Source: Android Questions

LEAVE A COMMENT