各位老师,你们好! 我是一个刚刚接触移动端的程序员,初步学习了flutter,在项目开发过程中,想寻找一些flutter的框架,发现了 fish_redux,在使用中遇到了一些问题,想请教您一下。
1.关于adapter的循环使用orgloginstatus_page,里面利用 orgloginstatus_adapter循环展示了 orgstatus_component的内容(通过API接口获取的数据ListA,接口报文类型为JSON),orgstatus_component是一个按钮,
我想实现的是 当点击按钮的时候,showDailog 一个循环列表(tellerstatus_component的内容),
Effect<OrgStatusComponentState> buildEffect(OpenDoorMapper openDoorMapper) {
return combineEffects(<Object, Effect<OrgStatusComponentState>>{
Lifecycle.initState: _init,
OrgStatusComponentAction.showTellerStatusEffect: _onShowTellerStatusEffect,
});
}
void _init(Action action, Context<OrgStatusComponentState> ctx) {}
void _onShowTellerStatusEffect(Action action, Context<OrgStatusComponentState> ctx) {
showDialog(
context: ctx.context,
builder: (BuildContext context) {
return ctx.buildComponent('dialog');
}
);
}列表内容是通过tellerdialog_component的effect API接口获取的
void _onRefresh(Action action, Context<TellerDialogState> ctx) async {
NetUtil.get(Api.TellerStatusMapper + '/' + ctx.state.openDoorMapper.orgid, (data){
List<TellerStatusMapper> tellerList = getTellerStatusMapperList(data);
ctx.dispatch(TellerDialogAdapterActionCreator.onSetNewData(tellerList));
}, errorCallBack: (errorMsg){
println("error: " + errorMsg);
});
}这个时候我在 tellerdialog_component下对应创建了一个 tellerdialog_adapter,用来循环展示tellerstaus_component的内容,
这样当我点击页面上的按钮时候,理想的是弹出showdailog的循环内容,可实际情况是报类型错误。
不知道为什么?
界面显示的是这样的
实际想实现的是这样的
2. 关于Navigator传参问题Navigator.of(ctx.context).pushNamed('aaa', arguments: action.payload); 时,怎么在 ‘aaa’ 页获取到 传递过来的 action.paload数据,是在‘aaa’的page里面,还是state里面,或者是effect里面?