public EditPersonalInfoScreen( EditPersonalInfoScreenViewModel viewModel = null, EditPersonalInfoScreenActionModel actionModel = null, Key key = null ) : base(key: key) { this.viewModel = viewModel; this.actionModel = actionModel; }
public override Widget build(BuildContext context) { return(new StoreConnector <AppState, EditPersonalInfoScreenViewModel>( converter: state => { var user = state.userState.userDict.ContainsKey(key: this.personalId) ? state.userState.userDict[key: this.personalId] : new User(); return new EditPersonalInfoScreenViewModel { personalId = this.personalId, user = user, fullName = state.userState.fullName, title = state.userState.title, jobRole = state.userState.jobRole, place = state.userState.place }; }, builder: (context1, viewModel, dispatcher) => { var actionModel = new EditPersonalInfoScreenActionModel { mainRouterPop = () => dispatcher.dispatch(new MainNavigatorPopAction()), editPersonalInfo = (fullName, title, jobRoleId, placeId) => dispatcher.dispatch <IPromise>(Actions.editPersonalInfo(fullName: fullName, title: title, jobRoleId: jobRoleId, placeId: placeId)), updateAvatar = image => dispatcher.dispatch <IPromise>(Actions.updateAvatar(image: image)), changeFullName = fullName => dispatcher.dispatch(new ChangePersonalFullNameAction { fullName = fullName }), changeTitle = title => dispatcher.dispatch(new ChangePersonalTitleAction { title = title }), changeJobRole = jobRole => dispatcher.dispatch(new ChangePersonalRoleAction { jobRole = jobRole }), cleanPersonalInfo = () => dispatcher.dispatch(new CleanPersonalInfoAction()), pushToJobRole = () => dispatcher.dispatch( new MainNavigatorPushToAction { routeName = MainNavigatorRoutes.PersonalRole } ) }; return new EditPersonalInfoScreen(viewModel: viewModel, actionModel: actionModel); } )); }