所以我开始学习 dart 和 flutter,在观看一些类(class)时我遇到了这个错误。是否在 flutter 中更改了某些内容,为什么它不起作用?另外,如果我没有附上需要的东西,我很抱歉,我是这个世界上的新人。谢谢!
error part
Column (
children: [
Pytanie(
pytania[_indekspytan]['tekstPytan'],
),
and here is the whole column
Column(
children: [
Pytanie(
pytania[_indekspytan]['tekstPytan'],
),
...(pytania[_indekspytan]['odpowiedzi'] as List<String> ).map((odpowiedz) { //kropki zapobiegaja tworzeniu 2 listy, podmienia wartosci
return Odpowiedz(_odpowiedzi, odpowiedz);
}).toList()
],
),
最佳答案
使用 toString() 怎么样
Pytanie(
pytania[_indekspytan]['tekstPytan']?.toString() ?? ''
),
关于 flutter 错误 : The argument type 'Object?' can't be assigned to the parameter type 'String' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66749996/