Jelajahi Sumber

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

panhui 6 tahun lalu
induk
melakukan
3bdc3907ef
2 mengubah file dengan 11 tambahan dan 17 penghapusan
  1. 6 15
      lib/pages/StartWindow.dart
  2. 5 2
      lib/pages/roomInfo.dart

+ 6 - 15
lib/pages/StartWindow.dart

@@ -19,7 +19,7 @@ class StartWindowState extends State<StartWindow> {
     await Future.delayed(const Duration(seconds: 1));
     if (_num == 0) {
       if (isNext) {
-        Navigator.pop(context);
+        Navigator.of(context).pop(false);
       }
       return;
     }
@@ -37,9 +37,9 @@ class StartWindowState extends State<StartWindow> {
   @override
   void initState() {
     super.initState();
-  
+
     Future.delayed(Duration.zero, () {
-     getNum();
+      getNum();
     });
   }
 
@@ -66,11 +66,7 @@ class StartWindowState extends State<StartWindow> {
               child: Column(
                 mainAxisAlignment: MainAxisAlignment.spaceBetween,
                 children: <Widget>[
-                  Text('点击确认开始游戏',
-                      style: TextStyle(
-                          color: Color(0xFFFDC372),
-                          fontSize: 20,
-                          fontWeight: FontWeight.w600)),
+                  Text('点击确认开始游戏', style: TextStyle(color: Color(0xFFFDC372), fontSize: 20, fontWeight: FontWeight.w600)),
                   _centerContent(),
                   Container(
                     child: RaisedButton(
@@ -86,9 +82,7 @@ class StartWindowState extends State<StartWindow> {
             )),
           ),
         ),
-        onWillPop: () {
-          
-        },
+        onWillPop: () {},
       ),
     );
   }
@@ -128,10 +122,7 @@ class StartWindowState extends State<StartWindow> {
               child: Center(
                 child: Text(
                   "$_num",
-                  style: TextStyle(
-                      color: Colors.white,
-                      fontSize: 32,
-                      fontWeight: FontWeight.w600),
+                  style: TextStyle(color: Colors.white, fontSize: 32, fontWeight: FontWeight.w600),
                 ),
               ),
             ),

+ 5 - 2
lib/pages/roomInfo.dart

@@ -66,7 +66,8 @@ class RoomInfoState extends State<RoomInfo> with SingleTickerProviderStateMixin
 
 //开始比赛确认按钮
   showStart() async {
-    final result = await Navigator.of(context).push(PageRouteBuilder(
+    bool result = await Navigator.of(context).push<bool>(
+      PageRouteBuilder(
         opaque: false,
         transitionDuration: Duration(milliseconds: 300),
         transitionsBuilder: (BuildContext context, Animation<double> animation, Animation<double> secondaryAnimation, Widget child) {
@@ -77,7 +78,9 @@ class RoomInfoState extends State<RoomInfo> with SingleTickerProviderStateMixin
         },
         pageBuilder: (BuildContext context, _, __) {
           return StartWindow();
-        }));
+        },
+      ),
+    );
 
     Toast.show(context, '加载中', -1, 'loading');
     Map<String, dynamic> data = {"id": playerInfo.id};