我使用的是颤振,并试图显示图像资产(question.answerImage),如果它不是空的。我编写了如下代码,但它返回一个错误。... if (question.answerImage!=null){question.answerImage},错误写入如下:
元素类型'Set<Widget?>‘不能分配给列表<
body: Center( mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.spaceAround,
children: <WidgetThe element type 'List<SizedBox>' can't be as
我正在实现一个定制的应用程序栏,我希望在action: [] Widget中向AppBar属性添加可选的小部件。但是,当我在action小部件列表中插入小部件时,我会得到一个错误,上面写着The element type 'Widget?'can't be assigned to the list type 'Widget'
我想要创建一个可选的小部件,以便在action属性中插入AppBar。extends StatelessWidget implements Prefe
我不明白在从子元素中删除正方形brackets[]之后,如何使用列小部件。我想从字符串元素列表中创建一个卡片列表。我使用了map方法来完成这个任务。我在列小部件中使用map方法,它经常显示错误The element type 'List<Card>' can't be assigned to the list type 'Widget'。我通过将flights.map((元素){})包装到另一个列小部件中,然