예제 #1
0
        public override void initState()
        {
            base.initState();
            SplashManager.hiddenAndroidSpalsh();
            fetchInitData();
            VersionManager.checkForUpdates(type: CheckVersionType.initialize);
            StatusBarManager.hideStatusBar(false);
            SplashManager.fetchSplash();
            AnalyticsManager.AnalyticsOpenApp();
            SchedulerBinding.instance.addPostFrameCallback(_ => {
                if (UserInfoManager.isLogin())
                {
                    var userId = UserInfoManager.getUserInfo().userId ?? "";
                    if (userId.isNotEmpty())
                    {
                        StoreProvider.store.dispatcher.dispatch(Actions.fetchUserProfile(userId: userId));
                    }

                    StoreProvider.store.dispatcher.dispatch(Actions.fetchChannels(1));
                    StoreProvider.store.dispatcher.dispatch(Actions.fetchCreateChannelFilter());
                }

                StoreProvider.store.dispatcher.dispatch(Actions.fetchReviewUrl());
            });
        }
예제 #2
0
 public override void initState()
 {
     base.initState();
     StatusBarManager.statusBarStyle(false);
     this._selectedIndex  = 1;
     this._pageController = new PageController(initialPage: this._selectedIndex);
     this._titleFontSize  = _maxTitleFontSize;
     this._navBarHeight   = _maxNavBarHeight;
     StatusBarManager.hideStatusBar(false);
     SplashManager.fetchSplash();
     AnalyticsManager.AnalyticsOpenApp();
     SchedulerBinding.instance.addPostFrameCallback(_ => { this.widget.actionModel.fetchReviewUrl(); });
     this._loginSubId = EventBus.subscribe(sName: EventBusConstant.login_success, args => {
         if (this._selectedIndex != 1)
         {
             this._selectedIndex = 1;
             this._pageController.animateToPage(
                 page: this._selectedIndex,
                 TimeSpan.FromMilliseconds(250),
                 curve: Curves.ease
                 );
         }
     });
     this._logoutSubId = EventBus.subscribe(sName: EventBusConstant.logout_success, args => {
         if (this._selectedIndex != 1)
         {
             this._selectedIndex = 1;
             this._pageController.animateToPage(
                 page: this._selectedIndex,
                 TimeSpan.FromMilliseconds(250),
                 curve: Curves.ease
                 );
         }
     });
 }