如何解决“在Flutter中不能将参数类型'Future '分配给参数类型'int'

问题描述 投票:0回答:1

我正在从表中返回行数,并尝试将其用作listview构建器中的itemCount。但是列表视图生成器显示此错误

The argument type 'Future<int>' can't be assigned to the parameter type 'int'

如何解决?

listview flutter dart future
1个回答
-1
投票

将方法的返回类型更改为Future而不是int。

© www.soinside.com 2019 - 2024. All rights reserved.