alibaba / fish-redux

An assembled flutter application framework.
https://github.com/alibaba/fish-redux
Apache License 2.0
7.33k stars 843 forks source link

flutter build web 时,list Component 报错 #703

Open MileeSally opened 4 years ago

MileeSally commented 4 years ago
error
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,);

}