@@ -37,43 +37,38 @@ class HomePage extends StatelessWidget {
3737 ));
3838 }
3939
40+ _renderTab (icon, text) {
41+ return new Tab (
42+ child: new Column (
43+ mainAxisAlignment: MainAxisAlignment .center,
44+ children: < Widget > [new Icon (icon, size: 16.0 ), new Text (text)],
45+ ),
46+ );
47+ }
48+
4049 // This widget is the root of your application.
4150 @override
4251 Widget build (BuildContext context) {
52+ List <Widget > tabs = [
53+ _renderTab (GSYICons .MAIN_DT , CommonUtils .getLocale (context).home_dynamic),
54+ _renderTab (GSYICons .MAIN_QS , CommonUtils .getLocale (context).home_trend),
55+ _renderTab (GSYICons .MAIN_MY , CommonUtils .getLocale (context).home_my),
56+ ];
4357 return WillPopScope (
4458 onWillPop: () {
4559 return _dialogExitApp (context);
4660 },
4761 child: new GSYTabBarWidget (
4862 drawer: new HomeDrawer (),
4963 type: GSYTabBarWidget .BOTTOM_TAB ,
50- tabItems: [
51- new Tab (
52- child: new Column (
53- mainAxisAlignment: MainAxisAlignment .center,
54- children: < Widget > [new Icon (GSYICons .MAIN_DT , size: 16.0 ), new Text (CommonUtils .getLocale (context).home_dynamic)],
55- ),
56- ),
57- new Tab (
58- child: new Column (
59- mainAxisAlignment: MainAxisAlignment .center,
60- children: < Widget > [new Icon (GSYICons .MAIN_QS , size: 16.0 ), new Text (CommonUtils .getLocale (context).home_trend)],
61- ),
62- ),
63- new Tab (
64- child: new Column (
65- mainAxisAlignment: MainAxisAlignment .center,
66- children: < Widget > [new Icon (GSYICons .MAIN_MY , size: 16.0 ), new Text (CommonUtils .getLocale (context).home_my)],
67- ),
68- ),
69- ],
64+ tabItems: tabs,
7065 tabViews: [
7166 new DynamicPage (),
7267 new TrendPage (),
7368 new MyPage (),
7469 ],
7570 backgroundColor: GSYColors .primarySwatch,
76- indicatorColor: Color (GSYColors .white),
71+ indicatorColor: Color (GSYColors .white),
7772 title: GSYTitleBar (
7873 GSYLocalizations .of (context).currentLocalized.app_name,
7974 iconData: GSYICons .MAIN_SEARCH ,
0 commit comments