Open MileeSally opened 4 years ago
class HomeListComponent extends Component<HomeListState> { HomeListComponent() : super( effect: buildEffect(), reducer: buildReducer(), view: buildView, dependencies: Dependencies<HomeListState>( adapter: NoneConn<HomeListState>() + HomeListAdapter(), slots: <String, Dependent<HomeListState>>{ }),); } class HomeListAdapter extends SourceFlowAdapter<HomeListState> { HomeListAdapter() : super( pool: <String, Component<Object>>{ Router.treatment2oPatientCell:Treatment2OPatientCellComponent(), }); } class HomeListConnector extends ConnOp<HomeState, HomeListState> with ReselectMixin { @override HomeListState computed(HomeState state) { return HomeListState()..items = state.items; } @override List factors(HomeState state) { return state.items ?? []; } // @override // ListState get(HomeState state) { // // TODO: implement get // return ListState()..items = state.items; // } // @override // ListState get(HomeState state) { // // TODO: implement get // return super.get(state); // } @override void set(HomeState state, HomeListState subState) { state.items = subState.items; // throw Exception('Unexcept to set HomeState from HomeBannerState'); } } class HomePage extends Page<HomeState, Map<String, dynamic>> { HomePage() : super( initState: initState, effect: buildEffect(), reducer: buildReducer(), view: buildView, dependencies: Dependencies<HomeState>( adapter: null, slots: <String, Dependent<HomeState>>{ 'banner': HomeBannerConnector() + BannerComponent(), 'list': HomeListConnector() + HomeListComponent(), }), middleware: <Middleware<HomeState>>[ ], wrapper:null,); }