1、new一个ImageRadioController;
2、直接使用ImageRadio,controller使用同一个ImageRadioController即可实现单选;
将单选组件的刷新回调函数保存在controller中,监听点击事件,点击后选中当前,并且回调controller中保存的其它回调函数,以通知同一个controller下其它组件取消选中,代码如下:
每初始化一个radio组件都会给controller添加一个makeMeUnselect方法,
销毁时去掉该方法,
组件onChange时selected变为true,同时触发controller的unSelectOther方法当前的callback不变其他的调用,触发didUpdateWidget生命周期,