Exemplo n.º 1
0
 public HistoryEventScreen(
     HistoryScreenViewModel viewModel     = null,
     HistoryScreenActionModel actionModel = null,
     Key key = null
     ) : base(key: key)
 {
     this.viewModel   = viewModel;
     this.actionModel = actionModel;
 }
Exemplo n.º 2
0
 public override Widget build(BuildContext context)
 {
     return(new StoreConnector <AppState, HistoryScreenViewModel>(
                converter: state => new HistoryScreenViewModel {
         articleHistory = state.articleState.articleHistory,
         eventHistory = state.eventState.eventHistory
     },
                builder: (context1, viewModel, dispatcher) => {
         var actionModel = new HistoryScreenActionModel {
             mainRouterPop = () => dispatcher.dispatch(new MainNavigatorPopAction()),
             deleteAllArticleHistory = () => dispatcher.dispatch(new DeleteAllArticleHistoryAction()),
             deleteAllEventHistory = () => dispatcher.dispatch(new DeleteAllEventHistoryAction())
         };
         return new HistoryScreen(viewModel, actionModel);
     }
                ));
 }
 public override Widget build(BuildContext context)
 {
     return(new StoreConnector <AppState, HistoryScreenViewModel>(
                converter: state => new HistoryScreenViewModel {
         articleHistory = state.articleState.articleHistory,
         isLoggedIn = state.loginState.isLoggedIn
     },
                builder: (context1, viewModel, dispatcher) => {
         var actionModel = new HistoryScreenActionModel {
             pushToLogin = () => dispatcher.dispatch(new MainNavigatorPushToAction {
                 routeName = MainNavigatorRoutes.Login
             }),
             pushToArticleDetail = id =>
                                   dispatcher.dispatch(new MainNavigatorPushToArticleDetailAction {
                 articleId = id
             }),
             pushToReport = (reportId, reportType) => dispatcher.dispatch(
                 new MainNavigatorPushToReportAction {
                 reportId = reportId,
                 reportType = reportType
             }
                 ),
             pushToBlock = articleId => {
                 dispatcher.dispatch(new BlockArticleAction {
                     articleId = articleId
                 });
                 dispatcher.dispatch(new DeleteArticleHistoryAction {
                     articleId = articleId
                 });
             },
             shareToWechat = (type, title, description, linkUrl, imageUrl) => dispatcher.dispatch <IPromise>(
                 Actions.shareToWechat(type: type, title: title, description: description, linkUrl: linkUrl,
                                       imageUrl: imageUrl)),
             deleteArticleHistory = id =>
                                    dispatcher.dispatch(new DeleteArticleHistoryAction {
                 articleId = id
             })
         };
         return new HistoryArticleScreen(viewModel: viewModel, actionModel: actionModel);
     }
                ));
 }
Exemplo n.º 4
0
 public override Widget build(BuildContext context)
 {
     return(new StoreConnector <AppState, HistoryScreenViewModel>(
                converter: state => new HistoryScreenViewModel {
         eventHistory = state.eventState.eventHistory
     },
                builder: (context1, viewModel, dispatcher) => {
         var actionModel = new HistoryScreenActionModel {
             pushToEventDetail = (id, type) =>
                                 dispatcher.dispatch(new MainNavigatorPushToEventDetailAction
             {
                 eventId = id, eventType = type
             }),
             deleteEventHistory = id =>
                                  dispatcher.dispatch(new DeleteEventHistoryAction {
                 eventId = id
             })
         };
         return new HistoryEventScreen(viewModel: viewModel, actionModel: actionModel);
     }
                ));
 }
Exemplo n.º 5
0
 public override Widget build(BuildContext context)
 {
     return(new StoreConnector <AppState, HistoryScreenViewModel>(
                converter: state => new HistoryScreenViewModel {
         articleHistory = state.articleState.articleHistory,
         isLoggedIn = state.loginState.isLoggedIn
     },
                builder: (context1, viewModel, dispatcher) => {
         var actionModel = new HistoryScreenActionModel {
             pushToLogin = () => dispatcher.dispatch(new MainNavigatorPushToAction {
                 routeName = MainNavigatorRoutes.Login
             }),
             pushToArticleDetail = id =>
                                   dispatcher.dispatch(new MainNavigatorPushToArticleDetailAction {
                 articleId = id
             }),
             pushToReport = (reportId, reportType) => dispatcher.dispatch(
                 new MainNavigatorPushToReportAction {
                 reportId = reportId,
                 reportType = reportType
             }
                 ),
             pushToBlock = articleId => {
                 dispatcher.dispatch(new BlockArticleAction {
                     articleId = articleId
                 });
                 dispatcher.dispatch(new DeleteArticleHistoryAction {
                     articleId = articleId
                 });
             },
             deleteArticleHistory = id =>
                                    dispatcher.dispatch(new DeleteArticleHistoryAction {
                 articleId = id
             })
         };
         return new HistoryArticleScreen(viewModel, actionModel);
     }
                ));
 }