Example #1
0
 public override Widget build(BuildContext context)
 {
     return(new StoreConnector <AppState, NotificationScreenViewModel>(
                converter: state => new NotificationScreenViewModel {
         notificationLoading = state.notificationState.loading,
         total = state.notificationState.total,
         notifications = state.notificationState.notifications,
         userDict = state.userState.userDict
     },
                builder: (context1, viewModel, dispatcher) => {
         var actionModel = new NotificationScreenActionModel {
             startFetchNotifications = () => dispatcher.dispatch(new StartFetchNotificationsAction()),
             fetchNotifications = pageNumber =>
                                  dispatcher.dispatch <IPromise>(Actions.fetchNotifications(pageNumber)),
             fetchMakeAllSeen = () => dispatcher.dispatch <IPromise>(Actions.fetchMakeAllSeen()),
             pushToArticleDetail = id => dispatcher.dispatch(
                 new MainNavigatorPushToArticleDetailAction {
                 articleId = id
             }
                 )
         };
         return new NotificationScreen(viewModel, actionModel);
     }
                ));
 }
Example #2
0
 public NotificationScreen(
     NotificationScreenViewModel viewModel     = null,
     NotificationScreenActionModel actionModel = null,
     Key key = null
     ) : base(key)
 {
     this.viewModel   = viewModel;
     this.actionModel = actionModel;
 }
 public override Widget build(BuildContext context)
 {
     return(new StoreConnector <AppState, NotificationScreenViewModel>(
                converter: state => new NotificationScreenViewModel {
         notificationLoading = state.notificationState.loading,
         page = state.notificationState.page,
         pageTotal = state.notificationState.pageTotal,
         notifications = state.notificationState.notifications,
         mentions = state.notificationState.mentions,
         userDict = state.userState.userDict,
         teamDict = state.teamState.teamDict,
         currentTabBarIndex = state.tabBarState.currentTabIndex
     },
                builder: (context1, viewModel, dispatcher) => {
         var actionModel = new NotificationScreenActionModel {
             startFetchNotifications = () => dispatcher.dispatch(new StartFetchNotificationsAction()),
             fetchNotifications = pageNumber =>
                                  dispatcher.dispatch <IPromise>(Actions.fetchNotifications(pageNumber: pageNumber)),
             fetchMakeAllSeen = () => dispatcher.dispatch <IPromise>(Actions.fetchMakeAllSeen()),
             pushToArticleDetail = id => dispatcher.dispatch(
                 new MainNavigatorPushToArticleDetailAction {
                 articleId = id
             }
                 ),
             pushToUserDetail = userId => dispatcher.dispatch(
                 new MainNavigatorPushToUserDetailAction {
                 userId = userId
             }
                 ),
             pushToTeamDetail = teamId => dispatcher.dispatch(
                 new MainNavigatorPushToTeamDetailAction {
                 teamId = teamId
             }
                 )
         };
         return new NotificationScreen(viewModel: viewModel, actionModel: actionModel);
     }
                ));
 }