panhui 6 anni fa
parent
commit
8982c7bce8

+ 0 - 0
images/2x/金币/小_白色.png → images/2x/icon2.png


+ 0 - 0
images/2x/info/钱包.png → images/2x/info1.png


+ 0 - 0
images/3x/金币/小_白色.png → images/3x/icon2.png


+ 0 - 0
images/3x/info/钱包.png → images/3x/info1.png


+ 0 - 0
images/金币/小_白色.png → images/icon2.png


+ 0 - 0
images/info/钱包.png → images/info1.png


+ 204 - 175
lib/pages/MatchPage.dart

@@ -38,7 +38,7 @@ class _MatchPageState extends State<MatchPage> with WidgetsBindingObserver {
   List<GameInfo> gameList = [];
   List<GameInfo> gameList = [];
   String gameName = '全部游戏';
   String gameName = '全部游戏';
   bool isFirst = true;
   bool isFirst = true;
-  FocusNode _focusNode=new FocusNode();
+  FocusNode _focusNode = new FocusNode();
 
 
   void showPicker(BuildContext context) {
   void showPicker(BuildContext context) {
     List<String> _list = [];
     List<String> _list = [];
@@ -182,192 +182,221 @@ class _MatchPageState extends State<MatchPage> with WidgetsBindingObserver {
   Widget build(BuildContext context) {
   Widget build(BuildContext context) {
     return WillPopScope(
     return WillPopScope(
       child: GestureDetector(
       child: GestureDetector(
-         behavior: HitTestBehavior.translucent,
+        behavior: HitTestBehavior.translucent,
         child: Scaffold(
         child: Scaffold(
-          appBar: AppBar(
-            title: Text('赛事'),
-            centerTitle: true,
-            leading: Material(
-              color: Colors.transparent,
-              child: Builder(
-                builder: (context) => InkWell(
-                      onTap: () async {
-                        bool result = await Navigator.push(context, CupertinoPageRoute(builder: (context) => TipList()));
-                        if (result) {
-                          getUnreadMsg();
-                        }
-                      },
-                      child: Image.asset('images/home_icon_xiaoxi.png'),
-                    ),
+            appBar: AppBar(
+              title: Text('赛事'),
+              centerTitle: true,
+              leading: Material(
+                color: Colors.transparent,
+                child: Builder(
+                  builder: (context) => InkWell(
+                        onTap: () async {
+                          bool result = await Navigator.push(context, CupertinoPageRoute(builder: (context) => TipList()));
+                          if (result) {
+                            getUnreadMsg();
+                          }
+                        },
+                        child: Image.asset('images/home_icon_xiaoxi.png'),
+                      ),
+                ),
               ),
               ),
+              actions: <Widget>[
+                Container(
+                  width: 102,
+                  padding: EdgeInsets.all(15),
+                  child: LinearButton(
+                    btntext: '发起比赛',
+                    textColor: Color(0xFFA2423E),
+                    btnHeight: 26.0,
+                    colorList: [Color(0xFFFFE77C), Color(0xFFFFE77C)],
+                    textSize: 12.0,
+                    onTapHomeMenu: () => {Navigator.push(context, CupertinoPageRoute(builder: (context) => OpenRoom(roomFlag: '0')))},
+                  ),
+                )
+              ],
             ),
             ),
-            actions: <Widget>[
-              Container(
-                width: 102,
-                padding: EdgeInsets.all(15),
-                child: LinearButton(
-                  btntext: '发起比赛',
-                  textColor: Color(0xFFA2423E),
-                  btnHeight: 26.0,
-                  colorList: [Color(0xFFFFE77C), Color(0xFFFFE77C)],
-                  textSize: 12.0,
-                  onTapHomeMenu: () => {Navigator.push(context, CupertinoPageRoute(builder: (context) => OpenRoom(roomFlag: '0')))},
-                ),
-              )
-            ],
-          ),
-          body: Container(
-            color: Color(0xFF2E3049),
-            height: double.infinity,
-            width: double.infinity,
-            child: RefreshIndicator(
-              color: Theme.of(context).primaryColor,
-              backgroundColor: Colors.white,
-              displacement: 10,
-              onRefresh: () async {
-                await Future.delayed(const Duration(seconds: 1));
-                gameId = 0;
-                currentPage = 1;
-                searchKey = '';
-                getRoomInfo();
-                // getBannerInfo();
-                getGame();
-              },
-              child: CustomScrollView(
-                physics: AlwaysScrollableScrollPhysics(),
-                controller: _controller,
-                slivers: <Widget>[
-                  SliverToBoxAdapter(
-                    child: Container(
-                      width: double.infinity,
-                      height: 200,
-                      child: new Swiper(
-                          itemBuilder: (BuildContext context, int index) {
-                            return Image.network(
-                              bannerList[index].imageUrl,
-                              fit: BoxFit.fill,
-                            );
-                          },
-                          itemCount: bannerList.length,
-                          loop: false,
-                          autoplay: true,
-                          autoplayDelay: 5000,
-                          pagination: SwiperPagination()),
+            body: Container(
+              color: Color(0xFF2E3049),
+              height: double.infinity,
+              width: double.infinity,
+              child: RefreshIndicator(
+                color: Theme.of(context).primaryColor,
+                backgroundColor: Colors.white,
+                displacement: 10,
+                onRefresh: () async {
+                  await Future.delayed(const Duration(seconds: 1));
+                  gameId = 0;
+                  currentPage = 1;
+                  searchKey = '';
+                  getRoomInfo();
+                  // getBannerInfo();
+                  getGame();
+                },
+                child: CustomScrollView(
+                  physics: AlwaysScrollableScrollPhysics(),
+                  controller: _controller,
+                  slivers: <Widget>[
+                    SliverToBoxAdapter(
+                      child: Container(
+                        width: double.infinity,
+                        height: 200,
+                        child: new Swiper(
+                            itemBuilder: (BuildContext context, int index) {
+                              return Image.network(
+                                bannerList[index].imageUrl,
+                                fit: BoxFit.fill,
+                              );
+                            },
+                            itemCount: bannerList.length,
+                            loop: false,
+                            autoplay: true,
+                            autoplayDelay: 5000,
+                            pagination: SwiperCustomPagination(builder: (BuildContext context, SwiperPluginConfig config) {
+                              Color activeColor = Color(0xFFD4504B);
+                              Color color = Colors.white;
+                              List<Widget> list = [];
+
+                              int itemCount = config.itemCount;
+                              int activeIndex = config.activeIndex;
+
+                              for (int i = 0; i < itemCount; ++i) {
+                                bool active = i == activeIndex;
+                                list.add(
+                                  Container(
+                                      key: Key("pagination_$i"),
+                                      margin:EdgeInsets.symmetric(vertical: 3,horizontal: 2),
+                                      child: Container(
+                                        width: active ? 8 : 3,
+                                        height: 3,
+                                        decoration: BoxDecoration(color: active ? activeColor : color, borderRadius: BorderRadius.all(Radius.circular(3))),
+                                      )),
+                                );
+                              }
+
+                              return Container(
+                                margin: EdgeInsets.only(top: 186),
+                                child: Row(
+                                  mainAxisAlignment: MainAxisAlignment.center,
+                                  children: list,
+                                ),
+                              );
+                            })),
+                      ),
                     ),
                     ),
-                  ),
-                  SliverPersistentHeader(
-                    pinned: true, //是否固定在顶部
-                    floating: true,
-                    delegate: _SliverAppBarDelegate(
-                        minHeight: 60, //收起的高度
-                        maxHeight: 60, //展开的最大高度
-                        child: Container(
-                          color: Color(0xFF2E3049),
-                          height: 60,
-                          padding: EdgeInsets.symmetric(vertical: 10, horizontal: 15),
+                    SliverPersistentHeader(
+                      pinned: true, //是否固定在顶部
+                      floating: true,
+                      delegate: _SliverAppBarDelegate(
+                          minHeight: 60, //收起的高度
+                          maxHeight: 60, //展开的最大高度
                           child: Container(
                           child: Container(
-                            decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.all(Radius.circular(4))),
-                            child: Row(
-                              children: <Widget>[
-                                Container(
-                                  width: 10,
-                                ),
-                                ImageIcon(
-                                  AssetImage('images/home_icon_sousuo.png'),
-                                  color: Color(0xFF727785),
-                                ),
-                                Expanded(
-                                  flex: 1,
-                                  child: Container(
-                                    height: 34,
-                                    decoration: BoxDecoration(
-                                      color: Colors.white,
-                                      borderRadius: BorderRadius.all(Radius.circular(100)),
+                            color: Color(0xFF2E3049),
+                            height: 60,
+                            padding: EdgeInsets.symmetric(vertical: 10, horizontal: 15),
+                            child: Container(
+                              decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.all(Radius.circular(4))),
+                              child: Row(
+                                children: <Widget>[
+                                  Container(
+                                    width: 10,
+                                  ),
+                                  ImageIcon(
+                                    AssetImage('images/home_icon_sousuo.png'),
+                                    color: Color(0xFF727785),
+                                  ),
+                                  Expanded(
+                                    flex: 1,
+                                    child: Container(
+                                      height: 34,
+                                      decoration: BoxDecoration(
+                                        color: Colors.white,
+                                        borderRadius: BorderRadius.all(Radius.circular(100)),
+                                      ),
+                                      child: ITextField(
+                                          hintText: '搜索竞赛房间',
+                                          inputBorder: InputBorder.none,
+                                          hintStyle: TextStyle(fontSize: 13, color: Color(0xFFB1B5C0), height: 1.2),
+                                          textStyle: TextStyle(color: Colors.black),
+                                          contentPadding: EdgeInsets.symmetric(vertical: 4, horizontal: 4),
+                                          fieldCallBack: (content) {
+                                            search(content);
+                                            _focusNode.unfocus();
+                                          },
+                                          focusNode: _focusNode,
+                                          counterStyle: TextStyle(color: Color(0xFF9BA0AE), fontSize: 0),
+                                          textInputAction: TextInputAction.search,
+                                          fileOnTap: () {
+                                            print('选择input');
+                                            if (_controller.position.pixels < 200) {
+                                              _controller.animateTo(200, duration: Duration(milliseconds: 300), curve: Curves.ease);
+                                            }
+                                          }),
                                     ),
                                     ),
-                                    child: ITextField(
-                                        hintText: '搜索竞赛房间',
-                                        inputBorder: InputBorder.none,
-                                        hintStyle: TextStyle(fontSize: 13, color: Color(0xFFB1B5C0), height: 1.2),
-                                        textStyle: TextStyle(color: Colors.black),
-                                        contentPadding: EdgeInsets.symmetric(vertical: 4, horizontal: 4),
-                                        fieldCallBack: (content) {
-                                          search(content);
-                                          _focusNode.unfocus();
-                                        },
-                                        focusNode: _focusNode,
-                                        counterStyle: TextStyle(color: Color(0xFF9BA0AE), fontSize: 0),
-                                        textInputAction: TextInputAction.search,
-                                        fileOnTap: () {
-                                          print('选择input');
-                                          if (_controller.position.pixels < 200) {
-                                            _controller.animateTo(200, duration: Duration(milliseconds: 300), curve: Curves.ease);
-                                          }
-                                        }),
                                   ),
                                   ),
-                                ),
-                                Container(
-                                  width: 1,
-                                  height: 10,
-                                  color: Color(0xFFB1B5C0),
-                                ),
-                                Container(
-                                    width: 99,
-                                    child: InkWell(
-                                        onTap: () {
-                                          showPicker(context);
-                                        },
-                                        child: Row(
-                                          mainAxisAlignment: MainAxisAlignment.center,
-                                          children: <Widget>[
-                                            Expanded(
-                                              flex: 1,
-                                              child: Container(
-                                                padding: EdgeInsets.only(left: 5),
-                                                alignment: Alignment.center,
-                                                child: Text(
-                                                  gameName,
-                                                  style: TextStyle(color: Color(0xFFB1B5C0)),
-                                                  overflow: TextOverflow.ellipsis,
+                                  Container(
+                                    width: 1,
+                                    height: 10,
+                                    color: Color(0xFFB1B5C0),
+                                  ),
+                                  Container(
+                                      width: 99,
+                                      child: InkWell(
+                                          onTap: () {
+                                            showPicker(context);
+                                          },
+                                          child: Row(
+                                            mainAxisAlignment: MainAxisAlignment.center,
+                                            children: <Widget>[
+                                              Expanded(
+                                                flex: 1,
+                                                child: Container(
+                                                  padding: EdgeInsets.only(left: 5),
+                                                  alignment: Alignment.center,
+                                                  child: Text(
+                                                    gameName,
+                                                    style: TextStyle(color: Color(0xFFB1B5C0)),
+                                                    overflow: TextOverflow.ellipsis,
+                                                  ),
                                                 ),
                                                 ),
                                               ),
                                               ),
-                                            ),
-                                            Image.asset('images/icon_zhankai_huise.png'),
-                                            Container(
-                                              width: 5,
-                                            )
-                                          ],
-                                        )))
+                                              Image.asset('images/icon_zhankai_huise.png'),
+                                              Container(
+                                                width: 5,
+                                              )
+                                            ],
+                                          )))
+                                ],
+                              ),
+                            ),
+                          )),
+                    ),
+                    SliverFixedExtentList(
+                      itemExtent: houseList.isEmpty ? 300 : 90,
+                      delegate: SliverChildBuilderDelegate((BuildContext context, int index) {
+                        if (houseList.isEmpty) {
+                          return Container(
+                            padding: EdgeInsets.only(top: 105),
+                            child: Column(
+                              children: <Widget>[
+                                Image.asset('images/icon_kong.png'),
+                                Text('暂时没有此房间哦~', style: TextStyle(fontSize: 14, color: Theme.of(context).primaryColor.withOpacity(0.3)))
                               ],
                               ],
                             ),
                             ),
-                          ),
-                        )),
-                  ),
-                  SliverFixedExtentList(
-                    itemExtent: houseList.isEmpty ? 300 : 90,
-                    delegate: SliverChildBuilderDelegate((BuildContext context, int index) {
-                      if (houseList.isEmpty) {
-                        return Container(
-                          padding: EdgeInsets.only(top: 105),
-                          child: Column(
-                            children: <Widget>[
-                              Image.asset('images/icon_kong.png'),
-                              Text('暂时没有此房间哦~', style: TextStyle(fontSize: 14, color: Theme.of(context).primaryColor.withOpacity(0.3)))
-                            ],
-                          ),
-                        );
-                      } else if (index == houseList.length) {
-                        return Text('更多房间敬请期待...', style: TextStyle(color: Colors.grey, fontSize: 13, height: 3), textAlign: TextAlign.center);
-                      }
-                      return HouseItem(houseList[index], houseList[index].gameInfo);
-                    }, childCount: houseList.length + 1),
-                  )
-                ],
+                          );
+                        } else if (index == houseList.length) {
+                          return Text('更多房间敬请期待...', style: TextStyle(color: Colors.grey, fontSize: 13, height: 3), textAlign: TextAlign.center);
+                        }
+                        return HouseItem(houseList[index], houseList[index].gameInfo);
+                      }, childCount: houseList.length + 1),
+                    )
+                  ],
+                ),
               ),
               ),
-            ),
-          )),
-          onTap: (){
-            _focusNode.unfocus();
-          },
+            )),
+        onTap: () {
+          _focusNode.unfocus();
+        },
       ),
       ),
       onWillPop: () {
       onWillPop: () {
         if (isFirst) {
         if (isFirst) {

+ 1 - 1
lib/pages/MyWallet.dart

@@ -178,7 +178,7 @@ class MyWalletState extends State<MyWallet> {
                       mainAxisAlignment: MainAxisAlignment.center,
                       mainAxisAlignment: MainAxisAlignment.center,
                       children: <Widget>[
                       children: <Widget>[
                         Image(
                         Image(
-                          image: AssetImage('images/金币/小_白色.png'),
+                          image: AssetImage('images/icon2.png'),
                           width: 20,
                           width: 20,
                         ),
                         ),
                         Container(width: 5,),
                         Container(width: 5,),

+ 3 - 3
lib/pages/UserPage.dart

@@ -115,7 +115,7 @@ class _UserPageState extends State<UserPage> with WidgetsBindingObserver {
                       ),
                       ),
                     ),
                     ),
                     DrawerMenu(
                     DrawerMenu(
-                      'images/info/钱包.png',
+                      'images/info1.png',
                       '我的参赛券',
                       '我的参赛券',
                       tipValue: userInfo.moneyTicket,
                       tipValue: userInfo.moneyTicket,
                       onTap: () {
                       onTap: () {
@@ -216,14 +216,14 @@ class DrawerMenu extends StatelessWidget {
                 margin: EdgeInsets.only(left: 16),
                 margin: EdgeInsets.only(left: 16),
                 child: Text(
                 child: Text(
                   title,
                   title,
-                  style: TextStyle(color: Colors.white, fontSize: 15, fontWeight: FontWeight.w700),
+                  style: TextStyle(color: Colors.white, fontSize: 15, fontWeight: FontWeight.w400),
                 ),
                 ),
               ),
               ),
             ),
             ),
             tipValue != null
             tipValue != null
                 ? Text(
                 ? Text(
                     tipValue.toString(),
                     tipValue.toString(),
-                    style: TextStyle(fontSize: 13, color: Theme.of(context).primaryColor),
+                    style: TextStyle(fontSize: 13, color: Theme.of(context).primaryColor,fontWeight: FontWeight.w600),
                   )
                   )
                 : Container(),
                 : Container(),
             Image.asset('images/icon_inter.png')
             Image.asset('images/icon_inter.png')

+ 1 - 1
lib/widget/LinearButton.dart

@@ -37,7 +37,7 @@ class LinearButton extends StatelessWidget {
               : Center(
               : Center(
                   child: Text(
                   child: Text(
                   btntext,
                   btntext,
-                  style: TextStyle(fontSize: textSize, fontWeight: FontWeight.w500, color: textColor),
+                  style: TextStyle(fontSize: textSize, fontWeight: FontWeight.w600, color: textColor),
                 )),
                 )),
         ),
         ),
       ),
       ),