【问题标题】:can anyone please explain in details what is happening in this code,i am stuck谁能详细解释这段代码中发生了什么,我被卡住了
【发布时间】:2020-03-21 08:51:19
【问题描述】:

谁能详细解释这段代码发生了什么,我卡住了

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

请帮帮我,提前谢谢

【问题讨论】:

标签: flutter flutter-layout


【解决方案1】:
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() 
  ], 
)

所以 Column 存在一个 Question 小部件和一些 Answer 小部件。您需要更多详细信息吗?

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2015-07-08
    • 1970-01-01
    • 2021-04-10
    • 2018-07-02
    • 1970-01-01
    • 2016-06-09
    相关资源
    最近更新 更多