任何人都可以详细解释这段代码中发生了什么吗?

时间:2020-03-21 08:51:19

标签: flutter flutter-layout

任何人都可以详细解释这段代码中发生的事情吗?我被困住了

Column(
  children: [
    Question(
      questions[_questionIndex]['questionText'],
    ),
    ...(questions[_questionIndex]['answers'] as List<String>)
        .map((answer) {
      return Answer(_answerQuestion, answer);
    }).toList()
  ],
)

请帮助我,谢谢!

1 个答案:

答案 0 :(得分:0)

Column( 
  children: [ 
    Question( questions[_questionIndex]['questionText'], ), ...   

    ( // I guess this brace should not be here

     questions[_questionIndex]['answers'] as List).map((answer) { 
        return Answer(_answerQuestion, answer); 
     }).toList() 
  ], 
)

因此,该列存在一个问题小部件和一些答案小部件。您需要更多详细信息吗?