【问题标题】: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 小部件。您需要更多详细信息吗?