Dart 如何从redux_epic调用错误操作?

Dart 如何从redux_epic调用错误操作?,dart,flutter,Dart,Flutter,我试着这样做: streamsearchepic( 流动作, EpicStore商店, ) { 返回actions.asyncMap((action)=>fetchPost() 。然后((结果)=>SearchResultsAction(结果['title'])) .catchError((error)=>SearchErrorAction(error.message)); } 但是,我收到以下错误消息: 类型“SearchErrorAction”不是类型“FutureOr SearchRes

我试着这样做:

streamsearchepic(
流动作,
EpicStore商店,
) {
返回actions.asyncMap((action)=>fetchPost()
。然后((结果)=>SearchResultsAction(结果['title']))
.catchError((error)=>SearchErrorAction(error.message));
}
但是,我收到以下错误消息:

类型“SearchErrorAction”不是类型“FutureOr SearchResultAction”的子类型


我只需要将我希望通过管道工作的类型定义为
动态
,如下所示:

streamsearchepic(
流动作,
EpicStore商店,
) {
返回actions.asyncMap((action)=>fetchPost()
。然后((结果)=>SearchResultsAction(结果['title']))
.catchError((error)=>SearchErrorAction(error.message));
}