Răsfoiți Sursa

Merge branch 'master' of http://git.izouma.com/panhui/mobileCyberGamesApp

panhui 6 ani în urmă
părinte
comite
9b35fba102

+ 1 - 1
android/app/build.gradle

@@ -39,7 +39,7 @@ android {
         versionName flutterVersionName
         testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
         ndk {
-            abiFilters 'armeabi-v7a'
+            // abiFilters 'armeabi-v7a'
         }
         manifestPlaceholders = [
             JPUSH_PKGNAME : applicationId,

BIN
fonts/DINEngschrift.ttf


+ 15 - 44
lib/pages/BindGame.dart

@@ -20,14 +20,10 @@ class BindGameState extends State<BindGame> {
 
   void getBindInfo() async {
     Toast.show(context, '加载中', -1, 'loading');
-    Result res = await HttpManager.get("bindGame/all", data: {
-      "gameId": 1,
-      "userId": StoreProvider.of<AppState>(context).state.userInfo.id
-    });
+    Result res = await HttpManager.get("bindGame/all", data: {"gameId": 1, "userId": StoreProvider.of<AppState>(context).state.userInfo.id});
     Toast.hide();
     if (res.success) {
       if (res.data.length > 0) {
-        print(res.data[0]);
         setState(() {
           isBind = true;
           bindInfo = BindGameInfo.fromJson(res.data[0]);
@@ -43,7 +39,7 @@ class BindGameState extends State<BindGame> {
   @override
   void initState() {
     super.initState();
-    Future.delayed(Duration(milliseconds: 50), () {
+    Future.delayed(Duration.zero, () {
       getBindInfo();
     });
   }
@@ -54,30 +50,22 @@ class BindGameState extends State<BindGame> {
       return;
     }
     Toast.show(context, '加载中', -1, 'loading');
-    Result res = await HttpManager.post("bindGame/save", data: {
-      "gameId": 1,
-      "userId": StoreProvider.of<AppState>(context).state.userInfo.id,
-      "nickName": bindName
-    });
+    Result res =
+        await HttpManager.post("bindGame/save", data: {"gameId": 1, "userId": StoreProvider.of<AppState>(context).state.userInfo.id, "nickName": bindName});
     Toast.hide();
     if (res.success) {
       Toast.show(context, '绑定成功', 1000, 'success');
-      Future.delayed(Duration(milliseconds: 1000), () {
-        getBindInfo();
-      });
+      getBindInfo();
     } else {}
   }
 
   void cancelBind() async {
     Toast.show(context, '加载中', -1, 'loading');
-    Result res =
-        await HttpManager.post("bindGame/del", data: {'id': bindInfo.id});
+    Result res = await HttpManager.post("bindGame/del", data: {'id': bindInfo.id});
     Toast.hide();
     if (res.success) {
       Toast.show(context, '解绑成功', 1000, 'success');
-      Future.delayed(Duration(milliseconds: 1000), () {
-        getBindInfo();
-      });
+      getBindInfo();
     } else {}
   }
 
@@ -99,10 +87,7 @@ class BindGameState extends State<BindGame> {
                 height: 220,
                 width: double.infinity,
                 // padding: EdgeInsets.symmetric(vertical: 15, horizontal: 34),
-                decoration: BoxDecoration(
-                    image: DecorationImage(
-                        image: AssetImage('images/img_chijizhanchang.png'),
-                        fit: BoxFit.cover)),
+                decoration: BoxDecoration(image: DecorationImage(image: AssetImage('images/img_chijizhanchang.png'), fit: BoxFit.cover)),
                 child: Column(
                   mainAxisAlignment: MainAxisAlignment.end,
                   children: _bindWidegt(),
@@ -119,11 +104,8 @@ class BindGameState extends State<BindGame> {
       widgetList.add(Container(
         height: 78,
         padding: EdgeInsets.all(15),
-        decoration: BoxDecoration(
-            gradient: LinearGradient(
-                colors: [Color(0xFF464B6A), Color(0xFF35395E)],
-                begin: Alignment.topCenter,
-                end: Alignment.bottomCenter)),
+        decoration:
+            BoxDecoration(gradient: LinearGradient(colors: [Color(0xFF464B6A), Color(0xFF35395E)], begin: Alignment.topCenter, end: Alignment.bottomCenter)),
         child: Row(
           children: <Widget>[
             Image.network(bindInfo.gameInfo.icon, width: 48),
@@ -136,8 +118,7 @@ class BindGameState extends State<BindGame> {
                   mainAxisAlignment: MainAxisAlignment.center,
                   crossAxisAlignment: CrossAxisAlignment.start,
                   children: <Widget>[
-                    Text(bindInfo.gameInfo.gameName,
-                        style: TextStyle(color: Colors.white, fontSize: 14)),
+                    Text(bindInfo.gameInfo.gameName, style: TextStyle(color: Colors.white, fontSize: 14)),
                     Container(
                       height: 5,
                     ),
@@ -145,20 +126,14 @@ class BindGameState extends State<BindGame> {
                       children: <Widget>[
                         Text(
                           "已绑定",
-                          style: TextStyle(
-                              color: Color(0xFF727785),
-                              fontSize: 13,
-                              fontWeight: FontWeight.w500),
+                          style: TextStyle(color: Color(0xFF727785), fontSize: 13, fontWeight: FontWeight.w500),
                         ),
                         Container(
                           width: 10,
                         ),
                         Text(
                           bindInfo.nickName,
-                          style: TextStyle(
-                              color: Colors.white,
-                              fontSize: 13,
-                              fontWeight: FontWeight.w500),
+                          style: TextStyle(color: Colors.white, fontSize: 13, fontWeight: FontWeight.w500),
                         )
                       ],
                     )
@@ -188,13 +163,9 @@ class BindGameState extends State<BindGame> {
           ),
           height: 40,
           child: TextField(
-            style: TextStyle(
-                color: Color(0xFFAF4946), fontWeight: FontWeight.w500),
+            style: TextStyle(color: Color(0xFFAF4946), fontWeight: FontWeight.w500),
             textAlign: TextAlign.center,
-            decoration: InputDecoration(
-                hintText: '请输入刺激战场游戏昵称',
-                border: InputBorder.none,
-                hintStyle: TextStyle(fontSize: 12, color: Color(0xFF727785))),
+            decoration: InputDecoration(hintText: '请输入刺激战场游戏昵称', border: InputBorder.none, hintStyle: TextStyle(fontSize: 12, color: Color(0xFF727785))),
             onChanged: (value) {
               setState(() {
                 bindName = value;

+ 2 - 10
lib/pages/CreateRoom.dart

@@ -37,22 +37,14 @@ class _CreateRoomBtn extends StatelessWidget {
   Widget build(BuildContext context) {
     return GestureDetector(
       onTap: () {
-        print(this.title);
-        Navigator.push(
-            context,
-            new CupertinoPageRoute(
-                builder: (context) => new OpenRoom(
-                    roomFlag: this.title == '创建普通房间' ? '0' : '1')));
+        Navigator.push(context, new CupertinoPageRoute(builder: (context) => new OpenRoom(roomFlag: this.title == '创建普通房间' ? '0' : '1')));
       },
       child: Container(
         width: 250,
         height: 96,
         decoration: BoxDecoration(
             border: Border.all(width: 1, color: Color(0x80000000)),
-            gradient: LinearGradient(
-                colors: [Color(0xFF626C85), Color(0xFF3D3E6C)],
-                begin: Alignment.topCenter,
-                end: Alignment.bottomCenter)),
+            gradient: LinearGradient(colors: [Color(0xFF626C85), Color(0xFF3D3E6C)], begin: Alignment.topCenter, end: Alignment.bottomCenter)),
         child: Center(
           child: Text(
             title,

+ 0 - 41
lib/pages/Example.dart

@@ -1,41 +0,0 @@
-import 'package:flutter/material.dart';
-import '../styles/colors.dart';
-import 'dart:ui';
-import '../styles/totast.dart';
-
-class Rechrage extends StatefulWidget {
-  @override
-  RechrageState createState() => RechrageState();
-}
-
-class RechrageState extends State<Rechrage> {
-  @override
-  Widget build(BuildContext context) {
-    return new WillPopScope(
-        child: Scaffold(
-        appBar: AppBar(
-          backgroundColor: PRIMARY_COLOR,
-          title: Text('充值'),
-          centerTitle: true,
-          elevation:0,
-        ),
-        body: RefreshIndicator(
-          color: PRIMARY_COLOR,
-          backgroundColor: BG_COLOR,
-          onRefresh: () async {
-            await new Future.delayed(const Duration(seconds: 1));
-            
-          },
-          child: Container(
-            color: BG_COLOR,
-          ),
-        )),
-        onWillPop: () {
-          Toast.hide();
-          print("返回键点击了");
-          Navigator.pop(context);
-          return Future.value(false);
-        });
- 
-  }
-}

+ 102 - 94
lib/pages/HomePage.dart

@@ -108,8 +108,8 @@ class _HomePageState extends State<HomePage> with WidgetsBindingObserver {
 
   @override
   void dispose() {
-    WidgetsBinding.instance.removeObserver(this);
     super.dispose();
+    WidgetsBinding.instance.removeObserver(this);
   }
 
   @override
@@ -176,7 +176,7 @@ class _HomePageState extends State<HomePage> with WidgetsBindingObserver {
                                               style: TextStyle(
                                                 color: Colors.white,
                                                 fontSize: 68,
-                                                fontFamily: 'AgencyFB',
+                                                fontFamily: 'DINEngschrift',
                                               ),
                                             ),
                                             Text(
@@ -184,7 +184,7 @@ class _HomePageState extends State<HomePage> with WidgetsBindingObserver {
                                               style: TextStyle(
                                                 color: Colors.white,
                                                 fontSize: 36,
-                                                fontFamily: 'AgencyFB',
+                                                fontFamily: 'DINEngschrift',
                                               ),
                                             )
                                           ],
@@ -275,55 +275,66 @@ class _HomePageState extends State<HomePage> with WidgetsBindingObserver {
             ],
           ),
         ),
-        Container(
-          child: GridView.count(
-            physics: new BouncingScrollPhysics(),
-            shrinkWrap: true,
-            crossAxisCount: 2,
-            children: <Widget>[
-              HomeMenu(
-                "images/home_icon_fangjian.png",
-                "创建房间",
-                onTapHomeMenu: () {
-                  Navigator.of(context).push(PageRouteBuilder(
-                      opaque: false,
-                      transitionDuration: Duration(milliseconds: 300),
-                      transitionsBuilder: (BuildContext context, Animation<double> animation, Animation<double> secondaryAnimation, Widget child) {
-                        return FadeTransition(
-                          opacity: CurvedAnimation(parent: animation, curve: Curves.linear),
-                          child: child,
-                        );
-                      },
-                      pageBuilder: (BuildContext context, _, __) {
-                        return CreateRoom();
-                      }));
-                },
-              ),
-              HomeMenu(
-                "images/home_icon_kuaisu.png",
-                "快速进入",
-                onTapHomeMenu: () {
-                  getOneRoom();
-                },
-              ),
-              HomeMenu(
-                "images/home_icon_sousuo.png",
-                "搜索",
-                onTapHomeMenu: () {
-                  Navigator.push(context, new CupertinoPageRoute(builder: (context) => new RoomList()));
-                },
-              ),
-              HomeMenu(
-                "images/home_icon_youjian.png",
-                "邮件",
-                onTapHomeMenu: () {
-                  Navigator.push(context, new CupertinoPageRoute(builder: (context) => new TipList()));
-                },
-                showBadge: showBadge,
+        Builder(
+          builder: (BuildContext context) {
+            double width = MediaQuery.of(context).size.width;
+            double height = MediaQuery.of(context).size.height;
+            double aspectRatio = 1;
+            if (height / width < 17 / 9) {
+              aspectRatio = width / (height - 334);
+            }
+            return Container(
+              child: GridView.count(
+                physics: new BouncingScrollPhysics(),
+                shrinkWrap: true,
+                crossAxisCount: 2,
+                childAspectRatio: aspectRatio,
+                children: <Widget>[
+                  HomeMenu(
+                    "images/home_icon_fangjian.png",
+                    "创建房间",
+                    onTapHomeMenu: () {
+                      Navigator.of(context).push(PageRouteBuilder(
+                          opaque: false,
+                          transitionDuration: Duration(milliseconds: 300),
+                          transitionsBuilder: (BuildContext context, Animation<double> animation, Animation<double> secondaryAnimation, Widget child) {
+                            return FadeTransition(
+                              opacity: CurvedAnimation(parent: animation, curve: Curves.linear),
+                              child: child,
+                            );
+                          },
+                          pageBuilder: (BuildContext context, _, __) {
+                            return CreateRoom();
+                          }));
+                    },
+                  ),
+                  HomeMenu(
+                    "images/home_icon_kuaisu.png",
+                    "快速进入",
+                    onTapHomeMenu: () {
+                      getOneRoom();
+                    },
+                  ),
+                  HomeMenu(
+                    "images/home_icon_sousuo.png",
+                    "搜索",
+                    onTapHomeMenu: () {
+                      Navigator.push(context, new CupertinoPageRoute(builder: (context) => new RoomList()));
+                    },
+                  ),
+                  HomeMenu(
+                    "images/home_icon_youjian.png",
+                    "邮件",
+                    onTapHomeMenu: () {
+                      Navigator.push(context, new CupertinoPageRoute(builder: (context) => new TipList()));
+                    },
+                    showBadge: showBadge,
+                  ),
+                ],
               ),
-            ],
-          ),
-        )
+            );
+          },
+        ),
       ],
     );
   }
@@ -342,51 +353,48 @@ class HomeMenu extends StatelessWidget {
     return Container(
       decoration:
           BoxDecoration(gradient: LinearGradient(begin: Alignment.topCenter, end: Alignment.bottomCenter, colors: [Color(0xFF626C85), Color(0xFF3D3E6C)])),
-      child: AspectRatio(
-        aspectRatio: 1,
-        child: Container(
-          decoration: BoxDecoration(
-              border: Border(
-                  left: BorderSide(width: 0.5, color: Color(0x80000000)),
-                  right: BorderSide(width: 0.5, color: Color(0x80000000)),
-                  bottom: BorderSide(width: 1, color: Color(0x80000000)))),
-          child: Material(
-            color: Colors.transparent,
-            child: InkWell(
-              onTap: onTapHomeMenu,
-              child: Column(
-                mainAxisAlignment: MainAxisAlignment.center,
-                children: <Widget>[
-                  Container(
-                    width: 44,
-                    height: 34,
-                    child: Stack(
-                      children: <Widget>[
-                        Image.asset(
-                          icon,
-                          fit: BoxFit.contain,
-                          width: 44,
-                          height: 34,
+      child: Container(
+        decoration: BoxDecoration(
+            border: Border(
+                left: BorderSide(width: 0.5, color: Color(0x80000000)),
+                right: BorderSide(width: 0.5, color: Color(0x80000000)),
+                bottom: BorderSide(width: 1, color: Color(0x80000000)))),
+        child: Material(
+          color: Colors.transparent,
+          child: InkWell(
+            onTap: onTapHomeMenu,
+            child: Column(
+              mainAxisAlignment: MainAxisAlignment.center,
+              children: <Widget>[
+                Container(
+                  width: 44,
+                  height: 34,
+                  child: Stack(
+                    children: <Widget>[
+                      Image.asset(
+                        icon,
+                        fit: BoxFit.contain,
+                        width: 44,
+                        height: 34,
+                      ),
+                      Positioned(
+                        right: 0,
+                        top: 0,
+                        child: Container(
+                          width: showBadge ? 10 : 0,
+                          height: showBadge ? 10 : 0,
+                          decoration: BoxDecoration(color: Color.fromARGB(255, 239, 0, 9), borderRadius: BorderRadius.all(Radius.circular(10))),
                         ),
-                        Positioned(
-                          right: 0,
-                          top: 0,
-                          child: Container(
-                            width: showBadge ? 10 : 0,
-                            height: showBadge ? 10 : 0,
-                            decoration: BoxDecoration(color: Color.fromARGB(255, 239, 0, 9), borderRadius: BorderRadius.all(Radius.circular(10))),
-                          ),
-                        )
-                      ],
-                    ),
+                      )
+                    ],
                   ),
-                  Text(
-                    title,
-                    style: TextStyle(color: Colors.white, fontSize: 14),
-                    textAlign: TextAlign.center,
-                  )
-                ],
-              ),
+                ),
+                Text(
+                  title,
+                  style: TextStyle(color: Colors.white, fontSize: 14),
+                  textAlign: TextAlign.center,
+                )
+              ],
             ),
           ),
         ),

+ 2 - 5
lib/pages/RecordList.dart

@@ -4,7 +4,6 @@ import 'dart:ui';
 import 'package:flutter/cupertino.dart';
 import '../styles/totast.dart';
 import '../model/PlayerInfo.dart';
-import '../styles/totast.dart';
 import '../net/HttpManager.dart';
 import '../net/Result.dart';
 import '../model/HouseInfo.dart';
@@ -37,7 +36,6 @@ class RecordListState extends State<RecordList> {
     }
     if (res.success) {
       for (var item in res.data['pp']) {
-        print(item['houseInfo']);
         PlayerInfo tip = PlayerInfo.fromJson(item);
         list.add(tip);
       }
@@ -48,7 +46,6 @@ class RecordListState extends State<RecordList> {
     setState(() {
       playerList = list;
     });
-    print(res.data['pp']);
   }
 
   @override
@@ -64,7 +61,7 @@ class RecordListState extends State<RecordList> {
       }
     });
 
-    Future.delayed(Duration(milliseconds: 100), () => getListPage());
+    Future.delayed(Duration.zero, () => getListPage());
   }
 
   @override
@@ -86,7 +83,7 @@ class RecordListState extends State<RecordList> {
           color: BG_SUB_COLOR,
           child: RefreshIndicator(
               color: PRIMARY_COLOR,
-              backgroundColor: BG_COLOR,
+              backgroundColor: Colors.white,
               onRefresh: () async {
                 await new Future.delayed(const Duration(seconds: 1));
                 currentPage = 1;

+ 16 - 52
lib/pages/TipInfo.dart

@@ -18,13 +18,11 @@ class TipInfo extends StatefulWidget {
 }
 
 class TipInfoState extends State<TipInfo> {
-  SystemNotice tipInfo = SystemNotice.fromJson(
-      {'content': '', "createTime": DateTime.now().microsecondsSinceEpoch});
+  SystemNotice tipInfo = SystemNotice.fromJson({'content': '', "createTime": DateTime.now().microsecondsSinceEpoch});
   HouseInfo houseInfo;
   getInfo() async {
     Toast.show(context, '加载中', -1, 'loading');
-    Result res = await HttpManager.get("systemNotice/getOne",
-        data: {'id': widget.tipId});
+    Result res = await HttpManager.get("systemNotice/getOne", data: {'id': widget.tipId});
     Toast.hide();
     if (res.success) {
       setState(() {
@@ -33,28 +31,23 @@ class TipInfoState extends State<TipInfo> {
     }
 
     if (tipInfo.statusFlag == 0 && tipInfo.typeFlag != 2) {
-      HttpManager.post("systemNotice/update",
-          data: {'id': tipInfo.id, "statusFlag": 1});
+      HttpManager.post("systemNotice/update", data: {'id': tipInfo.id, "statusFlag": 1});
     }
 
-    Result res2 = await HttpManager.get("houseInfo/getOne",
-        data: {'id': tipInfo.houseId});
+    Result res2 = await HttpManager.get("houseInfo/getOne", data: {'id': tipInfo.houseId});
     if (res2.success) {
       setState(() {
         houseInfo = HouseInfo.fromJson(res2.data);
       });
     }
-
-    
   }
 
   void updateHousInfo() {}
 
   @override
   void initState() {
-    
     super.initState();
-    Future.delayed(Duration(milliseconds: 100), () => getInfo());
+    Future.delayed(Duration.zero, () => getInfo());
   }
 
   @override
@@ -86,11 +79,7 @@ class TipInfoState extends State<TipInfo> {
                     children: <Widget>[
                       Padding(
                         padding: EdgeInsets.symmetric(vertical: 12),
-                        child: Text(
-                            readTimestamp(
-                                tipInfo.createTime, 'yyyy.MM.dd HH:mm:ss'),
-                            style:
-                                TextStyle(color: Colors.white24, fontSize: 13)),
+                        child: Text(readTimestamp(tipInfo.createTime, 'yyyy.MM.dd HH:mm:ss'), style: TextStyle(color: Colors.white24, fontSize: 13)),
                       ),
                       Container(
                         height: 1,
@@ -106,9 +95,7 @@ class TipInfoState extends State<TipInfo> {
                     ],
                   ),
                 ),
-                houseInfo != null
-                    ? houseItem(roomInfo: houseInfo, gameInfo: gameInfo)
-                    : Container(),
+                houseInfo != null ? houseItem(roomInfo: houseInfo, gameInfo: gameInfo) : Container(),
                 type == 2 && status == 0
                     ? Container(
                         width: double.infinity,
@@ -119,15 +106,11 @@ class TipInfoState extends State<TipInfo> {
                           child: Text('立即领取'),
                           onPressed: () async {
                             Toast.show(context, '加载中', -1, 'loading');
-                            Result res = await HttpManager.post(
-                                "playerInfo/receive",
-                                data: {"id": tipInfo.playerId});
+                            Result res = await HttpManager.post("playerInfo/receive", data: {"id": tipInfo.playerId});
                             Toast.hide();
-                            print(res.data);
                             if (res.success) {
                               Toast.show(context, '领取成功', 1000, 'success');
-                              Future.delayed(Duration(milliseconds: 1000),
-                                  () => getInfo());
+                              Future.delayed(Duration(milliseconds: 1000), () => getInfo());
                             } else {
                               Toast.show(context, res.error, 1000, 'info');
                             }
@@ -188,34 +171,26 @@ class houseItem extends StatelessWidget {
                             maxWidth: 170,
                             child: Text(
                               roomInfo.houseName,
-                              style: TextStyle(
-                                  color: Colors.white,
-                                  fontSize: 14,
-                                  fontWeight: FontWeight.w500),
+                              style: TextStyle(color: Colors.white, fontSize: 14, fontWeight: FontWeight.w500),
                               maxLines: 1,
                               overflow: TextOverflow.ellipsis,
                             ),
                           ),
                           Container(
                             margin: EdgeInsets.only(left: 6),
-                            child: Image.network(roomInfo.houseLevel.icon,
-                                width: 14),
+                            child: Image.network(roomInfo.houseLevel.icon, width: 14),
                           ),
                           Container(
                               margin: EdgeInsets.only(left: 1),
                               child: Text(
                                 roomInfo.houseLevel.levelName,
-                                style: TextStyle(
-                                    color: Color(0xFFF9D881), fontSize: 9),
+                                style: TextStyle(color: Color(0xFFF9D881), fontSize: 9),
                               )),
                         ],
                       ),
                       Text(
                         roomInfo.houseAbstract,
-                        style: TextStyle(
-                            fontSize: 12,
-                            fontWeight: FontWeight.w400,
-                            color: Color(0xFF9BA0AE)),
+                        style: TextStyle(fontSize: 12, fontWeight: FontWeight.w400, color: Color(0xFF9BA0AE)),
                         maxLines: 2,
                         overflow: TextOverflow.ellipsis,
                       )
@@ -227,15 +202,8 @@ class houseItem extends StatelessWidget {
                   children: <Widget>[
                     Image.asset('images/icon_renshu.png', width: 20),
                     Text(
-                      (roomInfo.playerNumber != null
-                              ? roomInfo.playerNumber.toString()
-                              : '0') +
-                          '/' +
-                          roomInfo.maxNumber.toString(),
-                      style: TextStyle(
-                          fontSize: 14,
-                          fontWeight: FontWeight.w500,
-                          color: Color(0xFFB1B2C0)),
+                      (roomInfo.playerNumber != null ? roomInfo.playerNumber.toString() : '0') + '/' + roomInfo.maxNumber.toString(),
+                      style: TextStyle(fontSize: 14, fontWeight: FontWeight.w500, color: Color(0xFFB1B2C0)),
                     )
                   ],
                 )
@@ -243,11 +211,7 @@ class houseItem extends StatelessWidget {
             ),
           ),
           onTap: () {
-            Navigator.push(
-                context,
-                new CupertinoPageRoute(
-                    builder: (context) =>
-                        new RoomInfo(roomId: roomInfo.id.toString())));
+            Navigator.push(context, new CupertinoPageRoute(builder: (context) => new RoomInfo(roomId: roomInfo.id.toString())));
           },
         ),
       ),

+ 14 - 39
lib/pages/TipList.dart

@@ -23,12 +23,11 @@ class TipListState extends State<TipList> {
 
   void getListPage() async {
     isMore = false;
-    Toast.show(context, '加载中', -1, 'loading');
-    Result res = await HttpManager.get("systemNotice/page", data: {
-      "userId": StoreProvider.of<AppState>(context).state.userInfo.id,
-      "currentPage": currentPage,
-      "pageNumber": 20
-    });
+    if (currentPage != 1) {
+      Toast.show(context, '加载中', -1, 'loading');
+    }
+    Result res = await HttpManager.get("systemNotice/page",
+        data: {"userId": StoreProvider.of<AppState>(context).state.userInfo.id, "currentPage": currentPage, "pageNumber": 20});
     Toast.hide();
     List<SystemNotice> list = tipList;
     if (currentPage == 1) {
@@ -50,12 +49,9 @@ class TipListState extends State<TipList> {
 
   @override
   void initState() {
-    
     super.initState();
     _mControll = new ScrollController();
-
-    Future.delayed(Duration(milliseconds: 100), () => getListPage());
-
+    Future.delayed(Duration.zero, () => getListPage());
     _mControll.addListener(() {
       if (_mControll.position.pixels == _mControll.position.maxScrollExtent) {
         if (isMore) {
@@ -68,7 +64,6 @@ class TipListState extends State<TipList> {
 
   @override
   void dispose() {
-    
     super.dispose();
     _mControll.dispose();
   }
@@ -85,10 +80,9 @@ class TipListState extends State<TipList> {
             ),
             body: RefreshIndicator(
               color: PRIMARY_COLOR,
-              backgroundColor: BG_COLOR,
+              backgroundColor: Colors.white,
               onRefresh: () async {
-                await new Future.delayed(const Duration(seconds: 1));
-                int currentPage = 1;
+                currentPage = 1;
                 getListPage();
               },
               child: Container(
@@ -101,19 +95,14 @@ class TipListState extends State<TipList> {
                       if (tipList.length == 0) {
                         return Text(
                           '数据正在火速加载中...',
-                          style: TextStyle(
-                              color: Colors.white30, fontSize: 13, height: 2),
+                          style: TextStyle(color: Colors.white30, fontSize: 13, height: 2),
                           textAlign: TextAlign.center,
                         );
                       }
                       return TipItem(
                           tipInfo: tipList[index],
                           tapInfo: () async {
-                            bool res = await Navigator.push(
-                                context,
-                                new CupertinoPageRoute(
-                                    builder: (context) =>
-                                        new TipInfo(tipId: tipList[index].id)));
+                            bool res = await Navigator.push(context, new CupertinoPageRoute(builder: (context) => new TipInfo(tipId: tipList[index].id)));
                             if (res != null) {
                               setState(() {
                                 tipList = [];
@@ -127,7 +116,6 @@ class TipListState extends State<TipList> {
             )),
         onWillPop: () {
           Toast.hide();
-          print("返回键点击了");
           Navigator.pop(context);
           return Future.value(false);
         });
@@ -164,22 +152,10 @@ class TipItem extends StatelessWidget {
                   child: Row(
                     mainAxisAlignment: MainAxisAlignment.spaceBetween,
                     children: <Widget>[
-                      Text(
-                          readTimestamp(
-                              tipInfo.createTime, 'yyyy.MM.dd HH:mm:ss'),
-                          style: TextStyle(
-                              color: Color(0xFF9BA0AE), fontSize: 13)),
+                      Text(readTimestamp(tipInfo.createTime, 'yyyy.MM.dd HH:mm:ss'), style: TextStyle(color: Color(0xFF9BA0AE), fontSize: 13)),
                       tipInfo.statusFlag == 0
-                          ? Text('未读',
-                              style: TextStyle(
-                                  color: Color(0xFFC2524D),
-                                  fontSize: 13,
-                                  fontWeight: FontWeight.w600))
-                          : Text('已读',
-                              style: TextStyle(
-                                  color: Color(0xFF000000),
-                                  fontSize: 13,
-                                  fontWeight: FontWeight.w600))
+                          ? Text('未读', style: TextStyle(color: Color(0xFFC2524D), fontSize: 13, fontWeight: FontWeight.w600))
+                          : Text('已读', style: TextStyle(color: Color(0xFF000000), fontSize: 13, fontWeight: FontWeight.w600))
                     ],
                   ),
                 ),
@@ -189,8 +165,7 @@ class TipItem extends StatelessWidget {
                 ),
                 Padding(
                   padding: EdgeInsets.only(top: 10, bottom: 15),
-                  child: Text(tipInfo.content,
-                      style: TextStyle(color: Colors.white, fontSize: 14)),
+                  child: Text(tipInfo.content, style: TextStyle(color: Colors.white, fontSize: 14)),
                 )
               ],
             ),

+ 6 - 18
lib/pages/loginFirst.dart

@@ -45,11 +45,7 @@ class LoginFirstState extends State<LoginFirst> {
                       ),
                       Container(
                         margin: EdgeInsets.only(top: 30),
-                        child: Text('手机快捷登录',
-                            style: TextStyle(
-                                color: Colors.white,
-                                fontSize: 28,
-                                fontWeight: FontWeight.w500)),
+                        child: Text('手机快捷登录', style: TextStyle(color: Colors.white, fontSize: 28, fontWeight: FontWeight.w500)),
                       ),
                       Container(
                           margin: EdgeInsets.only(top: 20),
@@ -57,10 +53,7 @@ class LoginFirstState extends State<LoginFirst> {
                               autofocus: true,
                               keyboardType: TextInputType.phone,
                               maxLength: 11,
-                              style: TextStyle(
-                                  color: Colors.white,
-                                  fontSize: 18,
-                                  fontWeight: FontWeight.w500),
+                              style: TextStyle(color: Colors.white, fontSize: 18, fontWeight: FontWeight.w500),
                               decoration: InputDecoration(
                                   hintText: "输入手机号",
                                   hintStyle: TextStyle(
@@ -83,14 +76,11 @@ class LoginFirstState extends State<LoginFirst> {
                                   //     width: 20,
                                   //   ),
                                   // ),
-                                  counterStyle: TextStyle(
-                                      color: BG_SUB_COLOR, fontSize: 0)),
+                                  counterStyle: TextStyle(color: BG_SUB_COLOR, fontSize: 0)),
                               onChanged: (value) {
                                 inputVal = value;
                               })),
-                      Text('未注册的手机号验证后自动创建账户',
-                          style: TextStyle(
-                              color: Color(0xFF727785), fontSize: 13)),
+                      Text('未注册的手机号验证后自动创建账户', style: TextStyle(color: Color(0xFF727785), fontSize: 13)),
                       Container(
                         margin: EdgeInsets.symmetric(vertical: 22),
                         width: double.infinity,
@@ -101,15 +91,13 @@ class LoginFirstState extends State<LoginFirst> {
                           highlightColor: Color(0xFF763434),
                           child: Text("下一步"),
                           onPressed: () {
-                            print(inputVal);
                             if (!checkPhone(inputVal)) {
                               Toast.show(context, '手机号格式错误', 1500, 'info');
                             } else {
                               Navigator.push(
                                 context,
                                 new CupertinoPageRoute(
-                                  builder: (context) =>
-                                      new LoginSecond(phone: inputVal),
+                                  builder: (context) => new LoginSecond(phone: inputVal),
                                 ),
                               );
                             }
@@ -123,7 +111,7 @@ class LoginFirstState extends State<LoginFirst> {
             ],
           ),
         )),
-        onWillPop: ()  {
+        onWillPop: () {
           Toast.hide();
           // Navigator.pop(context);
           return Future.value(false);

+ 26 - 23
lib/pages/loginSecond.dart

@@ -1,3 +1,5 @@
+import 'dart:async';
+
 import 'package:flutter/material.dart';
 import 'package:shared_preferences/shared_preferences.dart';
 import 'package:flutter/cupertino.dart';
@@ -26,11 +28,12 @@ class LoginSecondState extends State<LoginSecond> {
   int sendTime = 0;
   String inputCode;
   String useToken;
+  Timer timer;
 
   @override
   void initState() {
     super.initState();
-    Future.delayed(Duration(milliseconds: 100), () {
+    Future.delayed(Duration.zero, () {
       sendMsg();
     });
   }
@@ -75,6 +78,9 @@ class LoginSecondState extends State<LoginSecond> {
                                     onPressed: isSend
                                         ? null
                                         : () {
+                                            if (timer != null) {
+                                              timer.cancel();
+                                            }
                                             sendMsg();
                                           },
                                   )
@@ -128,6 +134,9 @@ class LoginSecondState extends State<LoginSecond> {
                                         data: {"phone": widget.phone, "code": inputCode, "sessionId": _sessionID, "requireToken": true});
                                     Toast.hide();
                                     if (res.success) {
+                                      if (timer != null) {
+                                        timer.cancel();
+                                      }
                                       final prefs = await SharedPreferences.getInstance();
                                       await prefs.setString('token', res.token);
                                       HttpManager.token = res.token;
@@ -135,11 +144,10 @@ class LoginSecondState extends State<LoginSecond> {
 
                                       Toast.show(context, '登录成功', 1500, 'success');
                                       Navigator.pushAndRemoveUntil(
-                                          context,
-                                          new CupertinoPageRoute(
-                                            builder: (context) => new HomePage(),
-                                          ),
-                                          ModalRoute.withName('/'));
+                                        context,
+                                        new CupertinoPageRoute(builder: (context) => new HomePage()),
+                                        ModalRoute.withName('/'),
+                                      );
                                     } else {
                                       Toast.show(context, res.error, 1500, 'info');
                                     }
@@ -172,25 +180,20 @@ class LoginSecondState extends State<LoginSecond> {
       setState(() {
         isSend = true;
       });
-      sendTime = 61;
-      getTime();
-    } else {
-      Toast.show(context, res.error, 1500, 'info');
-    }
-  }
-
-  void getTime() {
-    if (sendTime == 0) {
-      setState(() {
-        isSend = false;
+      sendTime = 60;
+      timer = Timer.periodic(new Duration(seconds: 1), (timer) {
+        if (sendTime == 0) {
+          setState(() {
+            isSend = false;
+          });
+        } else {
+          setState(() {
+            sendTime = sendTime - 1;
+          });
+        }
       });
     } else {
-      setState(() {
-        sendTime = sendTime - 1;
-      });
-      Future.delayed(Duration(milliseconds: 1000), () {
-        getTime();
-      });
+      Toast.show(context, res.error, 1500, 'info');
     }
   }
 }

+ 16 - 49
lib/pages/myWallet.dart

@@ -28,11 +28,8 @@ class MyWalletState extends State<MyWallet> {
   getWalletPage() async {
     Toast.show(context, '加载中', -1, 'loading');
     canNext = false;
-    Result res = await HttpManager.get("memberCoin/page", data: {
-      "userId": StoreProvider.of<AppState>(context).state.userInfo.id,
-      "currentPage": currentPage,
-      "pageNumber": 20
-    });
+    Result res = await HttpManager.get("memberCoin/page",
+        data: {"userId": StoreProvider.of<AppState>(context).state.userInfo.id, "currentPage": currentPage, "pageNumber": 20});
     Toast.hide();
     if (res.success) {
       if (currentPage == 1) {
@@ -45,7 +42,6 @@ class MyWalletState extends State<MyWallet> {
       if (res.data['page']['totalNumber'] > currentPage) {
         canNext = true;
       }
-      print(walletList);
     } else {}
   }
 
@@ -53,15 +49,14 @@ class MyWalletState extends State<MyWallet> {
   void initState() {
     super.initState();
     walletList = List<Map>();
-    Future.delayed(Duration(milliseconds: 100), () {
+    Future.delayed(Duration.zero, () {
       getWalletPage();
     });
     _controller = ScrollController();
     isShow = false;
 
     _controller.addListener(() {
-      if (_controller.position.pixels == _controller.position.maxScrollExtent &&
-          canNext) {
+      if (_controller.position.pixels == _controller.position.maxScrollExtent && canNext) {
         currentPage++;
         getWalletPage();
       }
@@ -93,7 +88,7 @@ class MyWalletState extends State<MyWallet> {
           return new Scaffold(
               body: RefreshIndicator(
             color: PRIMARY_COLOR,
-            backgroundColor: BG_COLOR,
+            backgroundColor: Colors.white,
             onRefresh: () async {
               await new Future.delayed(const Duration(seconds: 1));
               setState(() {
@@ -213,8 +208,7 @@ class MyWalletState extends State<MyWallet> {
           width: double.infinity,
           child: Text(
             '余额明细',
-            style: TextStyle(
-                color: Colors.white, fontSize: 16, fontWeight: FontWeight.w500),
+            style: TextStyle(color: Colors.white, fontSize: 16, fontWeight: FontWeight.w500),
           ),
           padding: EdgeInsets.only(
             left: 15,
@@ -238,15 +232,10 @@ class MyWalletState extends State<MyWallet> {
               child: Text(
                 '提现',
                 textAlign: TextAlign.center,
-                style: TextStyle(
-                    color: Colors.white,
-                    fontSize: 16,
-                    fontWeight: FontWeight.w500),
+                style: TextStyle(color: Colors.white, fontSize: 16, fontWeight: FontWeight.w500),
               ),
             ),
-            onTap: () {
-              print('提现');
-            },
+            onTap: () {},
           ),
         ),
         Container(
@@ -262,15 +251,10 @@ class MyWalletState extends State<MyWallet> {
                 child: Text(
                   '充值',
                   textAlign: TextAlign.center,
-                  style: TextStyle(
-                      color: Colors.white,
-                      fontSize: 16,
-                      fontWeight: FontWeight.w500),
+                  style: TextStyle(color: Colors.white, fontSize: 16, fontWeight: FontWeight.w500),
                 )),
             onTap: () {
-              print("充值");
-              Navigator.push(context,
-                  new CupertinoPageRoute(builder: (context) => new Rechrage()));
+              Navigator.push(context, new CupertinoPageRoute(builder: (context) => new Rechrage()));
             },
           ),
         )
@@ -286,11 +270,7 @@ class MyWalletState extends State<MyWallet> {
           return Container(
             padding: EdgeInsets.all(15),
             decoration: BoxDecoration(
-              border: BorderDirectional(
-                  top: BorderSide(
-                      width: 1,
-                      color: Color(0x2E000000),
-                      style: BorderStyle.solid)),
+              border: BorderDirectional(top: BorderSide(width: 1, color: Color(0x2E000000), style: BorderStyle.solid)),
               color: BG_COLOR,
             ),
             child: Row(
@@ -300,10 +280,7 @@ class MyWalletState extends State<MyWallet> {
                     width: 53,
                     child: Text(
                       walletList[index]['money'].toString(),
-                      style: TextStyle(
-                          color: Colors.white,
-                          fontSize: 20,
-                          fontWeight: FontWeight.w500),
+                      style: TextStyle(color: Colors.white, fontSize: 20, fontWeight: FontWeight.w500),
                     )),
                 Expanded(
                   flex: 1,
@@ -314,18 +291,11 @@ class MyWalletState extends State<MyWallet> {
                         walletList[index]['remark'],
                         maxLines: 1,
                         overflow: TextOverflow.ellipsis,
-                        style: TextStyle(
-                            color: Colors.white,
-                            fontSize: 14,
-                            fontWeight: FontWeight.w500),
+                        style: TextStyle(color: Colors.white, fontSize: 14, fontWeight: FontWeight.w500),
                       ),
                       Text(
-                        readTimestamp(walletList[index]['createTime'],
-                            'yyyy-MM-dd HH:mm:ss'),
-                        style: TextStyle(
-                            color: Color(0xFF727785),
-                            fontSize: 12,
-                            fontWeight: FontWeight.w400),
+                        readTimestamp(walletList[index]['createTime'], 'yyyy-MM-dd HH:mm:ss'),
+                        style: TextStyle(color: Color(0xFF727785), fontSize: 12, fontWeight: FontWeight.w400),
                       )
                     ],
                   ),
@@ -337,10 +307,7 @@ class MyWalletState extends State<MyWallet> {
           return Center(
             child: Text(
               '没有更多了',
-              style: TextStyle(
-                  color: Color(0xFF727785),
-                  fontSize: 12,
-                  fontWeight: FontWeight.w400),
+              style: TextStyle(color: Color(0xFF727785), fontSize: 12, fontWeight: FontWeight.w400),
             ),
           );
         }

+ 33 - 101
lib/pages/openRoom.dart

@@ -24,14 +24,9 @@ class OpenRoom extends StatefulWidget {
 
 class OpenRoomState extends State<OpenRoom> {
   TextStyle titleStyle = TextStyle(color: Colors.white, fontSize: 14);
-  TextStyle valStyle =
-      TextStyle(color: Colors.white, fontSize: 15, fontWeight: FontWeight.w500);
+  TextStyle valStyle = TextStyle(color: Colors.white, fontSize: 15, fontWeight: FontWeight.w500);
 
-  Map<String, dynamic> editRoomInfo = {
-    "gameId": 1,
-    "houseLevel": 1,
-    "maxNumber": 10
-  };
+  Map<String, dynamic> editRoomInfo = {"gameId": 1, "houseLevel": 1, "maxNumber": 10};
   List gameList = [];
   List levelList = [];
 
@@ -63,38 +58,26 @@ class OpenRoomState extends State<OpenRoom> {
       Toast.show(context, '请选择房间等级', 1500, 'info');
       return;
     }
-    if (editRoomInfo['houseType'] == '1' &&
-        (editRoomInfo['gameHouseId'] == null ||
-            editRoomInfo['gameHouseId'] == '')) {
+    if (editRoomInfo['houseType'] == '1' && (editRoomInfo['gameHouseId'] == null || editRoomInfo['gameHouseId'] == '')) {
       Toast.show(context, '请录入游戏房间号', 1500, 'info');
       return;
     }
-    if (editRoomInfo['houseType'] == '1' &&
-        (editRoomInfo['gameHousePassword'] == null ||
-            editRoomInfo['gameHousePassword'] == '')) {
+    if (editRoomInfo['houseType'] == '1' && (editRoomInfo['gameHousePassword'] == null || editRoomInfo['gameHousePassword'] == '')) {
       Toast.show(context, '请录入游戏房间密码', 1500, 'info');
       return;
     }
-    editRoomInfo['userId'] =
-        StoreProvider.of<AppState>(context).state.userInfo.id;
+    editRoomInfo['userId'] = StoreProvider.of<AppState>(context).state.userInfo.id;
     Toast.show(context, '加载中', -1, 'loading');
     Result res = await HttpManager.post("houseInfo/save", data: editRoomInfo);
     Toast.hide();
     if (res.success) {
-      HttpManager.post("houseInfo/join", data: {
-        "houseId": res.data,
-        "userId": StoreProvider.of<AppState>(context).state.userInfo.id
-      });
+      HttpManager.post("houseInfo/join", data: {"houseId": res.data, "userId": StoreProvider.of<AppState>(context).state.userInfo.id});
       Future.delayed(Duration(milliseconds: 100), () {
         Toast.show(context, '创建成功', 1500, 'success');
       });
       Future.delayed(Duration(milliseconds: 1500), () {
         Navigator.pushAndRemoveUntil(
-            context,
-            new CupertinoPageRoute(
-                builder: (context) =>
-                    new RoomInfo(roomId: res.data.toString())),
-            ModalRoute.withName('/'));
+            context, new CupertinoPageRoute(builder: (context) => new RoomInfo(roomId: res.data.toString())), ModalRoute.withName('/'));
       });
     } else {}
   }
@@ -102,11 +85,10 @@ class OpenRoomState extends State<OpenRoom> {
   @override
   void initState() {
     super.initState();
-    print(widget.roomFlag);
     editRoomInfo['houseType'] = widget.roomFlag;
-   
-     Future.delayed(Duration.zero, () {
-       getInfo();
+
+    Future.delayed(Duration.zero, () {
+      getInfo();
     });
   }
 
@@ -138,12 +120,10 @@ class OpenRoomState extends State<OpenRoom> {
   Widget build(BuildContext context) {
     Map chooseGameInfo = {};
     for (var item in gameList) {
-      print(item);
       if (item['id'].toString() == editRoomInfo['gameId'].toString()) {
         chooseGameInfo = item;
       }
     }
-    print(chooseGameInfo);
 
     Map chooseLevelInfo = {};
     for (var item in levelList) {
@@ -152,8 +132,6 @@ class OpenRoomState extends State<OpenRoom> {
       }
     }
 
-    print(chooseGameInfo);
-
     return WillPopScope(
       child: Scaffold(
           appBar: AppBar(
@@ -167,8 +145,7 @@ class OpenRoomState extends State<OpenRoom> {
                 child: FlatButton(
                   highlightColor: PRIMARY_COLOR,
                   padding: EdgeInsets.only(right: 0),
-                  child: Text('规则',
-                      style: TextStyle(color: Colors.white, fontSize: 13)),
+                  child: Text('规则', style: TextStyle(color: Colors.white, fontSize: 13)),
                   onPressed: () {},
                 ),
               )
@@ -194,9 +171,7 @@ class OpenRoomState extends State<OpenRoom> {
                               Expanded(
                                 flex: 1,
                                 child: Text(
-                                  chooseGameInfo.containsKey('gameName')
-                                      ? chooseGameInfo['gameName']
-                                      : '',
+                                  chooseGameInfo.containsKey('gameName') ? chooseGameInfo['gameName'] : '',
                                   textAlign: TextAlign.right,
                                   style: valStyle,
                                 ),
@@ -247,11 +222,8 @@ class OpenRoomState extends State<OpenRoom> {
                           Padding(
                             padding: EdgeInsets.only(top: 12),
                             child: Text(
-                              editRoomInfo.containsKey('video')
-                                  ? '已选择'
-                                  : '不上传则自动使用官方默认视频',
-                              style: TextStyle(
-                                  color: Color(0xFF9BA0AE), fontSize: 13),
+                              editRoomInfo.containsKey('video') ? '已选择' : '不上传则自动使用官方默认视频',
+                              style: TextStyle(color: Color(0xFF9BA0AE), fontSize: 13),
                             ),
                           )
                         ],
@@ -261,16 +233,14 @@ class OpenRoomState extends State<OpenRoom> {
                     Container(
                       height: 60,
                       color: BG_COLOR,
-                      padding:
-                          EdgeInsets.symmetric(horizontal: 15, vertical: 8),
+                      padding: EdgeInsets.symmetric(horizontal: 15, vertical: 8),
                       child: TextField(
                         textAlign: TextAlign.end,
                         style: valStyle,
                         maxLength: 10,
                         decoration: InputDecoration(
                             hintText: "请输入房间标题",
-                            hintStyle: TextStyle(
-                                color: Color(0xFF727785), fontSize: 13),
+                            hintStyle: TextStyle(color: Color(0xFF727785), fontSize: 13),
                             prefixIcon: Padding(
                               padding: EdgeInsets.symmetric(vertical: 12),
                               child: Text('房间标题', style: titleStyle),
@@ -290,16 +260,14 @@ class OpenRoomState extends State<OpenRoom> {
                     Container(
                       height: 60,
                       color: BG_COLOR,
-                      padding:
-                          EdgeInsets.symmetric(horizontal: 15, vertical: 8),
+                      padding: EdgeInsets.symmetric(horizontal: 15, vertical: 8),
                       child: TextField(
                         textAlign: TextAlign.end,
                         style: valStyle,
                         maxLength: 15,
                         decoration: InputDecoration(
                             hintText: "请输入房间简介",
-                            hintStyle: TextStyle(
-                                color: Color(0xFF727785), fontSize: 13),
+                            hintStyle: TextStyle(color: Color(0xFF727785), fontSize: 13),
                             prefixIcon: Padding(
                               padding: EdgeInsets.symmetric(vertical: 12),
                               child: Text('房间简介', style: titleStyle),
@@ -333,44 +301,25 @@ class OpenRoomState extends State<OpenRoom> {
                                   mainAxisAlignment: MainAxisAlignment.end,
                                   children: <Widget>[
                                     Image.network(
-                                      chooseLevelInfo.containsKey('icon')
-                                          ? chooseLevelInfo['icon']
-                                          : '',
+                                      chooseLevelInfo.containsKey('icon') ? chooseLevelInfo['icon'] : '',
                                       width: 22,
                                     ),
                                     Text(
-                                      chooseLevelInfo.containsKey('levelName')
-                                          ? chooseLevelInfo['levelName']
-                                          : '',
-                                      style:
-                                          TextStyle(color: Color(0xFFF9D881)),
+                                      chooseLevelInfo.containsKey('levelName') ? chooseLevelInfo['levelName'] : '',
+                                      style: TextStyle(color: Color(0xFFF9D881)),
                                     ),
                                     Padding(
-                                      padding:
-                                          EdgeInsets.only(left: 20, right: 2),
-                                      child: Image.asset(
-                                          'images/icon_jinbi_da_bai.png',
-                                          width: 20),
+                                      padding: EdgeInsets.only(left: 20, right: 2),
+                                      child: Image.asset('images/icon_jinbi_da_bai.png', width: 20),
                                     ),
                                     Text(
-                                      'X' +
-                                          (chooseLevelInfo
-                                                  .containsKey('entryCoin')
-                                              ? chooseLevelInfo['entryCoin']
-                                                  .toString()
-                                              : ''),
-                                      style: TextStyle(
-                                          color: Colors.white,
-                                          fontSize: 15,
-                                          fontWeight: FontWeight.w500),
+                                      'X' + (chooseLevelInfo.containsKey('entryCoin') ? chooseLevelInfo['entryCoin'].toString() : ''),
+                                      style: TextStyle(color: Colors.white, fontSize: 15, fontWeight: FontWeight.w500),
                                     )
                                   ],
                                 ),
                               ),
-                              Padding(
-                                  padding: EdgeInsets.only(left: 4),
-                                  child: Image.asset('images/icon_inter.png',
-                                      width: 24))
+                              Padding(padding: EdgeInsets.only(left: 4), child: Image.asset('images/icon_inter.png', width: 24))
                             ],
                           ),
                           onTap: () {
@@ -402,7 +351,6 @@ class OpenRoomState extends State<OpenRoom> {
                             ],
                           ),
                           onTap: () {
-                            print('111111');
                             showNumPicker(chooseLevelInfo);
                           },
                         )),
@@ -419,27 +367,17 @@ class OpenRoomState extends State<OpenRoom> {
                           children: <Widget>[
                             Padding(
                               padding: EdgeInsets.only(right: 6),
-                              child: Image.asset('images/icon_jinbi_da_bai.png',
-                                  width: 20),
+                              child: Image.asset('images/icon_jinbi_da_bai.png', width: 20),
                             ),
                             Text(
-                              'X' +
-                                  (chooseLevelInfo.containsKey('entryCoin')
-                                      ? chooseLevelInfo['entryCoin'].toString()
-                                      : ''),
-                              style: TextStyle(
-                                  color: Colors.white,
-                                  fontSize: 16,
-                                  fontWeight: FontWeight.w500),
+                              'X' + (chooseLevelInfo.containsKey('entryCoin') ? chooseLevelInfo['entryCoin'].toString() : ''),
+                              style: TextStyle(color: Colors.white, fontSize: 16, fontWeight: FontWeight.w500),
                             ),
                             Padding(
                               padding: EdgeInsets.only(left: 20),
                               child: Text(
                                 '创建房间',
-                                style: TextStyle(
-                                    color: Colors.white,
-                                    fontSize: 16,
-                                    fontWeight: FontWeight.w500),
+                                style: TextStyle(color: Colors.white, fontSize: 16, fontWeight: FontWeight.w500),
                               ),
                             )
                           ],
@@ -532,13 +470,11 @@ class OpenRoomState extends State<OpenRoom> {
     for (var item in gameList) {
       _list.add(item['gameName']);
     }
-    print(json.encode(_list));
     String PickerData = json.encode(_list);
     new Picker(
         confirmText: '确定',
         cancelText: "取消",
-        adapter: PickerDataAdapter<String>(
-            pickerdata: new JsonDecoder().convert(PickerData)),
+        adapter: PickerDataAdapter<String>(pickerdata: new JsonDecoder().convert(PickerData)),
         changeToFirst: true,
         textAlign: TextAlign.left,
         columnPadding: const EdgeInsets.all(8.0),
@@ -559,13 +495,11 @@ class OpenRoomState extends State<OpenRoom> {
     new Picker(
         confirmText: '确定',
         cancelText: "取消",
-        adapter: PickerDataAdapter<String>(
-            pickerdata: new JsonDecoder().convert(PickerData)),
+        adapter: PickerDataAdapter<String>(pickerdata: new JsonDecoder().convert(PickerData)),
         changeToFirst: true,
         textAlign: TextAlign.left,
         columnPadding: const EdgeInsets.all(8.0),
         onConfirm: (Picker picker, List value) {
-          print(value);
           setState(() {
             editRoomInfo['maxNumber'] = _list[value[0]];
           });
@@ -577,13 +511,11 @@ class OpenRoomState extends State<OpenRoom> {
     for (var item in levelList) {
       _list.add(item['levelName']);
     }
-    print(json.encode(_list));
     String PickerData = json.encode(_list);
     new Picker(
         confirmText: '确定',
         cancelText: "取消",
-        adapter: PickerDataAdapter<String>(
-            pickerdata: new JsonDecoder().convert(PickerData)),
+        adapter: PickerDataAdapter<String>(pickerdata: new JsonDecoder().convert(PickerData)),
         changeToFirst: true,
         textAlign: TextAlign.left,
         columnPadding: const EdgeInsets.all(8.0),

+ 39 - 141
lib/pages/rankList.dart

@@ -28,13 +28,8 @@ class RankListState extends State<RankList> {
   PlayerInfo myPlayInfo;
 
   void getUserRank() async {
-    print('***********');
-
-    Result res = await HttpManager.get("playerInfo/seasonUserRank", data: {
-      "seasonId": raceId,
-      "userId": StoreProvider.of<AppState>(context).state.userInfo.id
-    });
-    print(res.data);
+    Result res =
+        await HttpManager.get("playerInfo/seasonUserRank", data: {"seasonId": raceId, "userId": StoreProvider.of<AppState>(context).state.userInfo.id});
     if (res.success && res.data != null) {
       setState(() {
         myPlayInfo = PlayerInfo.fromJson(res.data);
@@ -52,11 +47,7 @@ class RankListState extends State<RankList> {
   void getListPage() async {
     scrollFlag = false;
     Toast.show(context, '加载中', -1, 'loading');
-    Result res = await HttpManager.get("playerInfo/seasonRankPage", data: {
-      "seasonId": raceId,
-      "currentPage": currentPage,
-      "pageNumber": 20
-    });
+    Result res = await HttpManager.get("playerInfo/seasonRankPage", data: {"seasonId": raceId, "currentPage": currentPage, "pageNumber": 20});
     Toast.hide();
     List<PlayerInfo> list = rankList;
     if (currentPage == 1) {
@@ -128,8 +119,7 @@ class RankListState extends State<RankList> {
     super.initState();
     _mcontroller = ScrollController();
     _mcontroller.addListener(() {
-      if (_mcontroller.position.pixels ==
-          _mcontroller.position.maxScrollExtent) {
+      if (_mcontroller.position.pixels == _mcontroller.position.maxScrollExtent) {
         if (scrollFlag) {
           currentPage++;
           getListPage();
@@ -137,9 +127,8 @@ class RankListState extends State<RankList> {
       }
     });
 
-    Future.delayed(Duration(milliseconds: 100), () => getUserRank());
-    
-      Future.delayed(Duration.zero, () {
+    Future.delayed(Duration.zero, () {
+      getUserRank();
       getSeasonInfo();
     });
   }
@@ -158,7 +147,7 @@ class RankListState extends State<RankList> {
             color: BG_SUB_COLOR,
             child: RefreshIndicator(
                 color: PRIMARY_COLOR,
-                backgroundColor: BG_COLOR,
+                backgroundColor: Colors.white,
                 onRefresh: () async {
                   await new Future.delayed(const Duration(seconds: 1));
                   getUserRank();
@@ -166,11 +155,7 @@ class RankListState extends State<RankList> {
                 child: CustomScrollView(
                   controller: _mcontroller,
                   physics: AlwaysScrollableScrollPhysics(),
-                  slivers: <Widget>[
-                    _sliverAppBar(),
-                    _slievrToBoxAdapter(),
-                    _sliverList()
-                  ],
+                  slivers: <Widget>[_sliverAppBar(), _slievrToBoxAdapter(), _sliverList()],
                 )),
           ),
           floatingActionButton: myPlayInfo == null
@@ -188,42 +173,28 @@ class RankListState extends State<RankList> {
                       Container(
                         width: 30,
                         height: 30,
-                        child: CircleAvatar(
-                            backgroundImage:
-                                NetworkImage(myPlayInfo.userInfo.icon ?? '')),
+                        child: CircleAvatar(backgroundImage: NetworkImage(myPlayInfo.userInfo.icon ?? '')),
                       ),
                       Padding(
                         padding: EdgeInsets.symmetric(horizontal: 10),
-                        child: Text(myPlayInfo.userInfo.nickname ?? '',
-                            style:
-                                TextStyle(color: Colors.white, fontSize: 14)),
+                        child: Text(myPlayInfo.userInfo.nickname ?? '', style: TextStyle(color: Colors.white, fontSize: 14)),
                       ),
                       Image.asset('images/icon_jinbi_da_bai.png', width: 20),
                       Padding(
                         padding: EdgeInsets.only(left: 2),
-                        child: Text((myPlayInfo.bonus ?? 0).toString(),
-                            style: TextStyle(
-                                color: Colors.white,
-                                fontSize: 14,
-                                fontWeight: FontWeight.w500)),
+                        child: Text((myPlayInfo.bonus ?? 0).toString(), style: TextStyle(color: Colors.white, fontSize: 14, fontWeight: FontWeight.w500)),
                       ),
                       myPlayInfo.rank == null
                           ? Container()
                           : Expanded(
                               flex: 1,
-                              child: Text(
-                                  '第 ' + myPlayInfo.rank.toString() + ' 名',
-                                  style: TextStyle(
-                                      color: Colors.white,
-                                      fontSize: 14,
-                                      fontWeight: FontWeight.w500),
-                                  textAlign: TextAlign.right),
+                              child: Text('第 ' + myPlayInfo.rank.toString() + ' 名',
+                                  style: TextStyle(color: Colors.white, fontSize: 14, fontWeight: FontWeight.w500), textAlign: TextAlign.right),
                             )
                     ],
                   ),
                 ),
-          floatingActionButtonLocation:
-              FloatingActionButtonLocation.centerDocked,
+          floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked,
         ),
         onWillPop: () {
           Toast.hide();
@@ -251,10 +222,7 @@ class RankListState extends State<RankList> {
                 children: <Widget>[
                   Text(
                     competitionSeason != null ? competitionSeason.season : '',
-                    style: TextStyle(
-                        color: Colors.white,
-                        fontSize: 13,
-                        fontWeight: FontWeight.w400),
+                    style: TextStyle(color: Colors.white, fontSize: 13, fontWeight: FontWeight.w400),
                   ),
                   Image.asset(
                     'images/icon_zhankai_baise.png',
@@ -273,8 +241,7 @@ class RankListState extends State<RankList> {
               },
               itemBuilder: (BuildContext context) {
                 return seasonList.map((choice) {
-                  return new PopupMenuItem(
-                      child: new Text(choice.season), value: choice.id);
+                  return new PopupMenuItem(child: new Text(choice.season), value: choice.id);
                 }).toList();
               }),
         ],
@@ -304,12 +271,7 @@ class RankListState extends State<RankList> {
               padding: EdgeInsets.symmetric(horizontal: 15),
               child: Container(
                 height: 36,
-                decoration: BoxDecoration(
-                    border: Border(
-                        bottom: BorderSide(
-                            width: 1,
-                            color: Colors.black26,
-                            style: BorderStyle.solid))),
+                decoration: BoxDecoration(border: Border(bottom: BorderSide(width: 1, color: Colors.black26, style: BorderStyle.solid))),
                 child: Row(
                   children: <Widget>[
                     Container(
@@ -317,8 +279,7 @@ class RankListState extends State<RankList> {
                       height: 36,
                       margin: EdgeInsets.only(right: 15),
                       child: CircleAvatar(
-                        backgroundImage:
-                            NetworkImage(rankList[index].userInfo.icon),
+                        backgroundImage: NetworkImage(rankList[index].userInfo.icon),
                       ),
                     ),
                     Expanded(
@@ -328,15 +289,10 @@ class RankListState extends State<RankList> {
                         crossAxisAlignment: CrossAxisAlignment.start,
                         children: <Widget>[
                           Text(rankList[index].userInfo.nickname,
-                              style: TextStyle(
-                                  color: PRIMARY_COLOR,
-                                  fontSize: 14,
-                                  height: 1.2),
-                              overflow: TextOverflow.ellipsis),
+                              style: TextStyle(color: PRIMARY_COLOR, fontSize: 14, height: 1.2), overflow: TextOverflow.ellipsis),
                           Row(
                             children: <Widget>[
-                              Image.asset('images/icon_jinbi_da_bai.png',
-                                  width: 20),
+                              Image.asset('images/icon_jinbi_da_bai.png', width: 20),
                               Padding(
                                 padding: EdgeInsets.only(left: 2),
                                 child: Text(rankList[index].bonus.toString(),
@@ -356,18 +312,10 @@ class RankListState extends State<RankList> {
                             width: 30,
                             height: 30,
                             margin: EdgeInsets.only(right: 33),
-                            decoration: BoxDecoration(
-                                image: DecorationImage(
-                                    image: AssetImage(
-                                        'images/icon_paihangbang_04.png'),
-                                    fit: BoxFit.cover)),
+                            decoration: BoxDecoration(image: DecorationImage(image: AssetImage('images/icon_paihangbang_04.png'), fit: BoxFit.cover)),
                             child: Text(
                               (index + 1).toString(),
-                              style: TextStyle(
-                                  color: Color(0xFF15151D),
-                                  fontSize: 12,
-                                  fontWeight: FontWeight.w500,
-                                  height: 2),
+                              style: TextStyle(color: Color(0xFF15151D), fontSize: 12, fontWeight: FontWeight.w500, height: 2),
                               textAlign: TextAlign.center,
                             ),
                           )
@@ -417,27 +365,15 @@ class RankListState extends State<RankList> {
                             begin: Alignment.topLeft,
                             colors: [Color(0xFFFECF01), Color(0xFFD48E00)],
                           ),
-                          boxShadow: [
-                            BoxShadow(
-                                color: Colors.black12,
-                                offset: Offset(2.0, 4.0),
-                                blurRadius: 4.0)
-                          ]),
-                      child: CircleAvatar(
-                          backgroundImage:
-                              NetworkImage(rankList[0].userInfo.icon))),
-                  Positioned(
-                      bottom: 0,
-                      left: 24,
-                      child: Image.asset('images/icon_paihangbang_01.png',
-                          width: 32))
+                          boxShadow: [BoxShadow(color: Colors.black12, offset: Offset(2.0, 4.0), blurRadius: 4.0)]),
+                      child: CircleAvatar(backgroundImage: NetworkImage(rankList[0].userInfo.icon))),
+                  Positioned(bottom: 0, left: 24, child: Image.asset('images/icon_paihangbang_01.png', width: 32))
                 ],
               ),
             ),
             Padding(
               padding: EdgeInsets.only(top: 7, bottom: 3),
-              child: Text(rankList[0].userInfo.nickname,
-                  style: TextStyle(color: Color(0xFF2E3049), fontSize: 14)),
+              child: Text(rankList[0].userInfo.nickname, style: TextStyle(color: Color(0xFF2E3049), fontSize: 14)),
             ),
             Row(
               children: <Widget>[
@@ -445,11 +381,7 @@ class RankListState extends State<RankList> {
                   padding: EdgeInsets.only(right: 2),
                   child: Image.asset('images/icon_jinbi_da_bai.png', width: 20),
                 ),
-                Text(rankList[0].bonus.toString(),
-                    style: TextStyle(
-                        color: Colors.white,
-                        fontSize: 14,
-                        fontWeight: FontWeight.w500))
+                Text(rankList[0].bonus.toString(), style: TextStyle(color: Colors.white, fontSize: 14, fontWeight: FontWeight.w500))
               ],
             )
           ],
@@ -474,46 +406,28 @@ class RankListState extends State<RankList> {
                           width: 70,
                           height: 70,
                           decoration: BoxDecoration(
-                              borderRadius:
-                                  BorderRadius.all(Radius.circular(70)),
+                              borderRadius: BorderRadius.all(Radius.circular(70)),
                               gradient: LinearGradient(
                                 begin: Alignment.topLeft,
                                 colors: [Color(0xFFE3E3E3), Color(0xFFC5C5C5)],
                               ),
-                              boxShadow: [
-                                BoxShadow(
-                                    color: Colors.black12,
-                                    offset: Offset(2.0, 4.0),
-                                    blurRadius: 4.0)
-                              ]),
-                          child: CircleAvatar(
-                              backgroundImage:
-                                  NetworkImage(rankList[1].userInfo.icon))),
-                      Positioned(
-                          bottom: 0,
-                          left: 19,
-                          child: Image.asset('images/icon_paihangbang_02.png',
-                              width: 32))
+                              boxShadow: [BoxShadow(color: Colors.black12, offset: Offset(2.0, 4.0), blurRadius: 4.0)]),
+                          child: CircleAvatar(backgroundImage: NetworkImage(rankList[1].userInfo.icon))),
+                      Positioned(bottom: 0, left: 19, child: Image.asset('images/icon_paihangbang_02.png', width: 32))
                     ],
                   ),
                 ),
                 Padding(
                   padding: EdgeInsets.only(top: 7, bottom: 3),
-                  child: Text(rankList[1].userInfo.nickname,
-                      style: TextStyle(color: Color(0xFF2E3049), fontSize: 14)),
+                  child: Text(rankList[1].userInfo.nickname, style: TextStyle(color: Color(0xFF2E3049), fontSize: 14)),
                 ),
                 Row(
                   children: <Widget>[
                     Padding(
                       padding: EdgeInsets.only(right: 2),
-                      child: Image.asset('images/icon_jinbi_da_bai.png',
-                          width: 20),
+                      child: Image.asset('images/icon_jinbi_da_bai.png', width: 20),
                     ),
-                    Text(rankList[1].bonus.toString(),
-                        style: TextStyle(
-                            color: Colors.white,
-                            fontSize: 14,
-                            fontWeight: FontWeight.w500))
+                    Text(rankList[1].bonus.toString(), style: TextStyle(color: Colors.white, fontSize: 14, fontWeight: FontWeight.w500))
                   ],
                 )
               ],
@@ -541,27 +455,15 @@ class RankListState extends State<RankList> {
                             begin: Alignment.topLeft,
                             colors: [Color(0xFFF89E58), Color(0xFFE77023)],
                           ),
-                          boxShadow: [
-                            BoxShadow(
-                                color: Colors.black12,
-                                offset: Offset(2.0, 4.0),
-                                blurRadius: 4.0)
-                          ]),
-                      child: CircleAvatar(
-                          backgroundImage:
-                              NetworkImage(rankList[2].userInfo.icon))),
-                  Positioned(
-                      bottom: 0,
-                      left: 19,
-                      child: Image.asset('images/icon_paihangbang_03.png',
-                          width: 32))
+                          boxShadow: [BoxShadow(color: Colors.black12, offset: Offset(2.0, 4.0), blurRadius: 4.0)]),
+                      child: CircleAvatar(backgroundImage: NetworkImage(rankList[2].userInfo.icon))),
+                  Positioned(bottom: 0, left: 19, child: Image.asset('images/icon_paihangbang_03.png', width: 32))
                 ],
               ),
             ),
             Padding(
               padding: EdgeInsets.only(top: 7, bottom: 3),
-              child: Text(rankList[2].userInfo.nickname,
-                  style: TextStyle(color: Color(0xFF2E3049), fontSize: 14)),
+              child: Text(rankList[2].userInfo.nickname, style: TextStyle(color: Color(0xFF2E3049), fontSize: 14)),
             ),
             Row(
               children: <Widget>[
@@ -569,11 +471,7 @@ class RankListState extends State<RankList> {
                   padding: EdgeInsets.only(right: 2),
                   child: Image.asset('images/icon_jinbi_da_bai.png', width: 20),
                 ),
-                Text(rankList[2].bonus.toString(),
-                    style: TextStyle(
-                        color: Colors.white,
-                        fontSize: 14,
-                        fontWeight: FontWeight.w500))
+                Text(rankList[2].bonus.toString(), style: TextStyle(color: Colors.white, fontSize: 14, fontWeight: FontWeight.w500))
               ],
             )
           ],

+ 1 - 1
lib/pages/recharge.dart

@@ -83,7 +83,7 @@ class RechrageState extends State<Rechrage> {
             },
             child: RefreshIndicator(
               color: PRIMARY_COLOR,
-              backgroundColor: BG_COLOR,
+              backgroundColor: Colors.white,
               onRefresh: () async {
                 await new Future.delayed(const Duration(seconds: 1));
               },

+ 2 - 12
lib/pages/roomInfo.dart

@@ -98,7 +98,6 @@ class RoomInfoState extends State<RoomInfo> with SingleTickerProviderStateMixin
     bool success = true;
     if (result) {
       success = await ScreenStreamPlugin.start('rtmp://47.96.141.102:1935/myapp/' + playerInfo.userId.toString() + '?playerInfoId=' + playerInfo.id.toString());
-      print('stream screen:' + success.toString());
       if (success) {
         data['statusFlag'] = 2;
       } else {
@@ -157,7 +156,6 @@ class RoomInfoState extends State<RoomInfo> with SingleTickerProviderStateMixin
                   Toast.show(context, '加载中', -1, 'loading');
                   HttpManager.post("playerInfo/update", data: {'id': playerInfo.id, 'statusFlag': 3});
                   bool success = await ScreenStreamPlugin.stop();
-                  print('stop stream screen:' + success.toString());
                   Toast.hide();
                   Navigator.of(context).pop();
                 },
@@ -216,7 +214,6 @@ class RoomInfoState extends State<RoomInfo> with SingleTickerProviderStateMixin
         );
       },
     ).then((val) {
-      print(val);
       Navigator.of(context).pop();
     });
   }
@@ -225,7 +222,6 @@ class RoomInfoState extends State<RoomInfo> with SingleTickerProviderStateMixin
   checkJoinInfo() async {
     Result res = await HttpManager.get("playerInfo/getOne", data: {"userId": StoreProvider.of<AppState>(context).state.userInfo.id, "houseId": widget.roomId});
     if (res.success) {
-      print(res.data);
       if (res.data == null) {
         if (isPop) {
           return;
@@ -390,7 +386,7 @@ class RoomInfoState extends State<RoomInfo> with SingleTickerProviderStateMixin
     return Container(
       child: RefreshIndicator(
           color: PRIMARY_COLOR,
-          backgroundColor: BG_SUB_COLOR,
+          backgroundColor: Colors.white,
           displacement: 10,
           onRefresh: () async {
             await new Future.delayed(const Duration(seconds: 1));
@@ -517,10 +513,6 @@ class RoomInfoState extends State<RoomInfo> with SingleTickerProviderStateMixin
     int statusFlag = houseInfo != null ? houseInfo.statusFlag : 1;
     int playerStatus = playerInfo != null ? playerInfo.statusFlag : 0;
 
-    print('*******');
-    print(statusFlag);
-    print(playerStatus);
-
     if (!isJoin && statusFlag == 0) {
       return Container(
         width: ScreenUtil().setWidth(375),
@@ -785,7 +777,6 @@ class SecondPageState extends State<SecondPage> {
       list = [];
     }
     if (res.success) {
-      print(res.data['pp']);
       for (var item in res.data['pp']) {
         PlayerInfo jonPlayer = PlayerInfo.fromJson(item);
         list.add(jonPlayer);
@@ -797,7 +788,6 @@ class SecondPageState extends State<SecondPage> {
     setState(() {
       joinList = list;
     });
-    print(joinList);
   }
 
   @override
@@ -828,7 +818,7 @@ class SecondPageState extends State<SecondPage> {
   Widget build(BuildContext context) {
     return RefreshIndicator(
       color: PRIMARY_COLOR,
-      backgroundColor: BG_SUB_COLOR,
+      backgroundColor: Colors.white,
       displacement: 10,
       onRefresh: () async {
         await new Future.delayed(const Duration(seconds: 1));

+ 15 - 41
lib/pages/roomList.dart

@@ -46,7 +46,7 @@ class RoomListState extends State<RoomList> {
   @override
   void initState() {
     super.initState();
-    
+
     _controller = ScrollController();
     _controller.addListener(() {
       if (_controller.position.pixels == _controller.position.maxScrollExtent) {
@@ -58,11 +58,10 @@ class RoomListState extends State<RoomList> {
         }
       }
     });
-   Future.delayed(Duration.zero, () {
-     getRoomInfo();
-       getInfo();
+    Future.delayed(Duration.zero, () {
+      getRoomInfo();
+      getInfo();
     });
-   
   }
 
   getInfo() async {
@@ -75,11 +74,9 @@ class RoomListState extends State<RoomList> {
 
     Result res2 = await HttpManager.get("houseLevel/all");
     if (res2.success) {
-      print(res2.data);
       setState(() {
         levelList.addAll(res2.data);
       });
-      print(levelList);
     }
   }
 
@@ -93,7 +90,6 @@ class RoomListState extends State<RoomList> {
   Widget build(BuildContext context) {
     ScreenUtil.instance = ScreenUtil(width: 375, height: 667)..init(context);
 
-    
     return new Scaffold(
         appBar: AppBar(
           backgroundColor: PRIMARY_COLOR,
@@ -103,7 +99,7 @@ class RoomListState extends State<RoomList> {
         ),
         body: RefreshIndicator(
           color: PRIMARY_COLOR,
-          backgroundColor: BG_COLOR,
+          backgroundColor: Colors.white,
           onRefresh: () async {
             await new Future.delayed(const Duration(seconds: 1));
             setState(() {
@@ -126,8 +122,7 @@ class RoomListState extends State<RoomList> {
                     ),
                     SliverFixedExtentList(
                       itemExtent: ScreenUtil().setWidth(78),
-                      delegate: SliverChildBuilderDelegate(
-                          (BuildContext context, int index) {
+                      delegate: SliverChildBuilderDelegate((BuildContext context, int index) {
                         return RommItem(
                           roomInfo: roomList[index],
                           hasBorder: true,
@@ -153,12 +148,7 @@ class RoomListState extends State<RoomList> {
         color: Color(0xFF3A3D5C),
         child: Row(
           mainAxisAlignment: MainAxisAlignment.spaceBetween,
-          children: <Widget>[
-            _chooseGame(),
-            _chooseHouseType(),
-            _chooseLevel(),
-            _chooseStatus()
-          ],
+          children: <Widget>[_chooseGame(), _chooseHouseType(), _chooseLevel(), _chooseStatus()],
         ),
       ),
     );
@@ -168,7 +158,6 @@ class RoomListState extends State<RoomList> {
   Widget _chooseGame() {
     Map gameInfo = {};
     for (var item in gameList) {
-      print(item['id']);
       if (item['id'].toString() == game_id.toString()) {
         gameInfo = item;
       }
@@ -186,10 +175,7 @@ class RoomListState extends State<RoomList> {
                 flex: 1,
                 child: Text(
                   gameInfo['gameName'],
-                  style: TextStyle(
-                      color: game_id != '' ? PRIMARY_COLOR : Colors.white,
-                      fontSize: 12,
-                      fontWeight: FontWeight.w500),
+                  style: TextStyle(color: game_id != '' ? PRIMARY_COLOR : Colors.white, fontSize: 12, fontWeight: FontWeight.w500),
                   overflow: TextOverflow.ellipsis,
                   textAlign: TextAlign.center,
                 ),
@@ -222,10 +208,8 @@ class RoomListState extends State<RoomList> {
 
 //选择等级
   Widget _chooseLevel() {
-    print(levelList);
     Map levelInfo = {};
     for (var item in levelList) {
-      print(item['id']);
       if (item['id'].toString() == house_level.toString()) {
         levelInfo = item;
       }
@@ -243,10 +227,7 @@ class RoomListState extends State<RoomList> {
                 flex: 1,
                 child: Text(
                   levelInfo['levelName'],
-                  style: TextStyle(
-                      color: house_level != '' ? PRIMARY_COLOR : Colors.white,
-                      fontSize: 12,
-                      fontWeight: FontWeight.w500),
+                  style: TextStyle(color: house_level != '' ? PRIMARY_COLOR : Colors.white, fontSize: 12, fontWeight: FontWeight.w500),
                   overflow: TextOverflow.ellipsis,
                   textAlign: TextAlign.center,
                 ),
@@ -298,10 +279,7 @@ class RoomListState extends State<RoomList> {
                 flex: 1,
                 child: Text(
                   typeInfo['name'],
-                  style: TextStyle(
-                      color: house_type != '' ? PRIMARY_COLOR : Colors.white,
-                      fontSize: 12,
-                      fontWeight: FontWeight.w500),
+                  style: TextStyle(color: house_type != '' ? PRIMARY_COLOR : Colors.white, fontSize: 12, fontWeight: FontWeight.w500),
                   overflow: TextOverflow.ellipsis,
                   textAlign: TextAlign.center,
                 ),
@@ -353,10 +331,7 @@ class RoomListState extends State<RoomList> {
                 flex: 1,
                 child: Text(
                   statusInfo['name'],
-                  style: TextStyle(
-                      color: status_flag != '' ? PRIMARY_COLOR : Colors.white,
-                      fontSize: 12,
-                      fontWeight: FontWeight.w500),
+                  style: TextStyle(color: status_flag != '' ? PRIMARY_COLOR : Colors.white, fontSize: 12, fontWeight: FontWeight.w500),
                   overflow: TextOverflow.ellipsis,
                   textAlign: TextAlign.center,
                 ),
@@ -410,14 +385,13 @@ class RoomListState extends State<RoomList> {
     }
     if (status_flag != '') {
       data['advancedQuery'] += 'AND_,status_flag_,=_,' + status_flag + '_;';
-    }
-    else{
-      data['statusStr'] ='0,4';
+    } else {
+      data['statusStr'] = '0,4';
     }
     Result res = await HttpManager.get("houseInfo/page", data: data);
-    if (res.success&&res.data['pp']!=null) {
+    if (res.success && res.data['pp'] != null) {
       setState(() {
-       roomList.addAll(res.data['pp']); 
+        roomList.addAll(res.data['pp']);
       });
       if (res.data['page']['currentPage'] < res.data['page']['totalPage']) {
         scrollFlag = true;

+ 11 - 10
lib/pages/setting.dart

@@ -4,7 +4,9 @@ import 'package:flutter/cupertino.dart';
 import 'package:flutter_screenutil/flutter_screenutil.dart';
 import 'package:dio/dio.dart';
 import 'package:intl/intl.dart';
+import 'package:jpush_flutter/jpush_flutter.dart';
 import 'package:package_info/package_info.dart';
+import 'package:shared_preferences/shared_preferences.dart';
 import '../styles/colors.dart';
 import 'dart:io';
 import 'dart:async';
@@ -76,7 +78,7 @@ class SettingState extends State<Setting> {
                   children: <Widget>[
                     RefreshIndicator(
                       color: PRIMARY_COLOR,
-                      backgroundColor: BG_SUB_COLOR,
+                      backgroundColor: Colors.white,
                       displacement: 10,
                       onRefresh: () async {
                         await new Future.delayed(const Duration(seconds: 1));
@@ -151,13 +153,16 @@ class SettingState extends State<Setting> {
                             "退出登录",
                             style: TextStyle(fontSize: 16, fontWeight: FontWeight.w700),
                           ),
-                          onPressed: () {
-                            Future.delayed(const Duration(seconds: 1), () {
-                              StoreProvider.of<AppState>(context).dispatch(UpdateUserAction(null));
-                            });
-
+                          onPressed: () async {
                             Toast.show(context, '退出成功', 1500, 'success');
                             Navigator.push(context, new MaterialPageRoute(builder: (context) => new LoginFirst()));
+                            final prefs = await SharedPreferences.getInstance();
+                            prefs.remove('token');
+                            JPush jpush = JPush();
+                            jpush.deleteAlias();
+                            // Future.delayed(const Duration(seconds: 1), () {
+                            //   StoreProvider.of<AppState>(context).dispatch(UpdateUserAction(null));
+                            // });
                           }),
                     )
                   ],
@@ -172,9 +177,6 @@ class SettingState extends State<Setting> {
   }
 
   void updateUserInfo(userInfo, value, key) async {
-    print(userInfo);
-    print(value);
-    print(key);
     if (Toast.preToast == null) {
       Toast.show(context, '加载中', -1, 'loading');
     }
@@ -304,7 +306,6 @@ class SettingState extends State<Setting> {
       },
     );
     if (res != null) {
-      print(res);
       updateUserInfo(userInfo, res.millisecondsSinceEpoch, 'birthday');
     }
   }

+ 1 - 1
lib/redux/UserRedux.dart

@@ -18,7 +18,7 @@ final userReducer = combineReducers<UserInfo>([
 UserInfo _updateLoaded(UserInfo userInfo, action) {
   JPush jpush = JPush();
   if (action.userInfo != null) {
-    if (userInfo.id != action.userInfo.id) {
+    if (userInfo == null || (userInfo.id != action.userInfo.id)) {
       jpush.setAlias(action.userInfo.id.toString()).then((map) {});
     }
   } else {

+ 1 - 1
lib/widget/HomeDrawer.dart

@@ -27,7 +27,7 @@ class HomeDrawerState extends State<HomeDrawer> {
   @override
   void initState() {
     super.initState();
-    Future.delayed(Duration(milliseconds: 100), () => getUserInfo);
+    Future.delayed(Duration.zero, () => getUserInfo());
   }
 
   @override