如题,我在BottomNavigationBar调用了一个点击方法,代码如下bottomNavigationBar: BottomNavigationBar( backgroundColor: Colors.white, unselectedItemColor: Colors.black54, elevation: 1, selectedItemColor: Colors.deepOrange, type: BottomNavigationBarType.fixed, onTap: (currentIndex) { dispatch(EntranceActionCreator.onChangeIndexAction(currentIndex)); },
Action:static Action onChangeIndexAction(int index) { return Action(EntranceAction.changeIndexAction, payload: index); }
Effect:void _onChangeIndexAction(Action action, Context<EntranceState> ctx) { println("buildEffect---changeIndex"); int selectedIndex = action.payload; ctx.state.mainPageController.jumpToPage(selectedIndex); }
Reducer:EntranceState _onAction(EntranceState state, Action action) { final EntranceState newState = state.clone(); newState.selectedIndex = action.payload; return newState; }
打过断点,应该是没刷新,请问需要如何解决
1条答案
按热度按时间smdncfj31#
reducer 没有被执行。所以不会rebuid。