class UserList extends StatelessWidget {
Widget build(BuildContext context) {
final但是,我得到了type 'List<Widget>' is not a subtype of type 'Widget'错误。在这种情况下,如何将List<Widget>类型转换为Widget类型?
我是Flutter的新手。我在构造函数中调用future方法时遇到了问题。我创建了一个方法,它返回一个依赖于所选项目的小部件类。但是我看到错误"type ' Future‘is not a subtype of type 'Widget'“如果我添加了void类型而不是Future类型,它将被执行一次来创建一个主体。return DataB(); if (selectedValue == "c") {