BlocBuilder<RateFetchCubit, RateFetchState>(
builder: (context, state) {
if (state is RateFetchInitial) {
return const SpinKitFadingCircle(
color: Colors.grey,
size: 50.0,
);
} else if (state is MarketListed) {
state.channel.stream.listen((event) {
var dataList = Market.fromJson(jsonDecode(event.toString())
as Map<String, Iterable<dynamic>>);
print(event.toString());
return ListView.builder(
itemCount: 5,
itemBuilder: (context,index){
return const Text("");
}); });
}
}
return Container();
},
)
我越来越
返回类型“ListView”不是闭包上下文所要求的“void”。dartreturn_of_invalid_type_from_closure
1条答案
按热度按时间0ejtzxu11#
错误:您的
ListView.builder
在state.channel.stream.listen
内部,请将其取出现在
改成
代码: