Пример #1
0
 public override Widget build(BuildContext context)
 {
     return(new StoreConnector <AppState, SettingScreenViewModel>(
                converter: state => new SettingScreenViewModel {
         anonymous = state.loginState.loginInfo.anonymous,
         hasReviewUrl = state.settingState.hasReviewUrl,
         reviewUrl = state.settingState.reviewUrl
     },
                builder: (context1, viewModel, dispatcher) => {
         var actionModel = new SettingScreenActionModel {
             mainRouterPop = () => dispatcher.dispatch(new MainNavigatorPopAction()),
             mainRouterPushTo = routeName => dispatcher.dispatch(new MainNavigatorPushToAction {
                 routeName = routeName
             }),
             openUrl = url => dispatcher.dispatch(new OpenUrlAction {
                 url = url
             }),
             clearCache = () => dispatcher.dispatch(new SettingClearCacheAction()),
             logout = () => {
                 dispatcher.dispatch(new LogoutAction());
                 dispatcher.dispatch(new MainNavigatorPopAction());
             }
         };
         return new SettingScreen(viewModel, actionModel);
     }
                ));
 }
Пример #2
0
 public override Widget build(BuildContext context)
 {
     return(new StoreConnector <AppState, SettingScreenViewModel>(
                converter: state =>
     {
         return new SettingScreenViewModel
         {
             products = state.settingState.products.ToArray(),
             allIcons = state.settingState.allIcons,
             objects = state.settingState.objects,
         };
     },
                builder: (context1, viewModel, dispatcher) =>
     {
         var actionModel = new SettingScreenActionModel
         {
             ChangeIndex = (value) =>
             { dispatcher.dispatch(new ChangeIndexAction()
                 {
                     index = value,
                 }); },
         };
         return new SettingScreen(viewModel: viewModel, actionModel: actionModel);
     }
                ));
 }
Пример #3
0
 public SettingScreen(
     SettingScreenViewModel viewModel     = null,
     SettingScreenActionModel actionModel = null,
     Key key = null
     ) : base(key)
 {
     this.viewModel   = viewModel;
     this.actionModel = actionModel;
 }