我是Flutter的新手。我在构造函数中调用future方法时遇到了问题。我创建了一个方法,它返回一个依赖于所选项目的小部件类。但是我看到错误"type ' Future‘is not a subtype of type 'Widget'“如果我添加了void类型而不是Future类型,它将被执行一次来创建一个主体。return DataB(); if (selectedVa
class UserList extends StatelessWidget {
Widget build(BuildContext context) {
final但是,我得到了type 'List<Widget>' is not a subtype of type 'Widget'错误。在这种情况下,如何将List<Widget>类型转换为Widget类型?
据我所知,第一步和第二步正在按预期工作,因为我能够在设备内的应用程序文件夹中找到下载的PDF,并且可以用我测试过的PDF阅读器打开PDF。= DocumentDownloader(widget.document);
if (kIsWeb时收到的错误消息,我的假设是,由于一个未知的原因(因为PDFDocument.fromFile存在),P
当我尝试将buildProfileHeader()放入ListView的children中时,我得到了错误type Future<dynamic> is not a subtype of type Widget@override
return Scaffold( body: ListView(
childr