x1ongzhu 6 lat temu
rodzic
commit
92a3d9841c
2 zmienionych plików z 7 dodań i 16 usunięć
  1. 6 15
      lib/pages/StartWindow.dart
  2. 1 1
      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));
     await Future.delayed(const Duration(seconds: 1));
     if (_num == 0) {
     if (_num == 0) {
       if (isNext) {
       if (isNext) {
-        Navigator.pop(context);
+        Navigator.of(context).pop(false);
       }
       }
       return;
       return;
     }
     }
@@ -37,9 +37,9 @@ class StartWindowState extends State<StartWindow> {
   @override
   @override
   void initState() {
   void initState() {
     super.initState();
     super.initState();
-  
+
     Future.delayed(Duration.zero, () {
     Future.delayed(Duration.zero, () {
-     getNum();
+      getNum();
     });
     });
   }
   }
 
 
@@ -66,11 +66,7 @@ class StartWindowState extends State<StartWindow> {
               child: Column(
               child: Column(
                 mainAxisAlignment: MainAxisAlignment.spaceBetween,
                 mainAxisAlignment: MainAxisAlignment.spaceBetween,
                 children: <Widget>[
                 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(),
                   _centerContent(),
                   Container(
                   Container(
                     child: RaisedButton(
                     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: Center(
                 child: Text(
                 child: Text(
                   "$_num",
                   "$_num",
-                  style: TextStyle(
-                      color: Colors.white,
-                      fontSize: 32,
-                      fontWeight: FontWeight.w600),
+                  style: TextStyle(color: Colors.white, fontSize: 32, fontWeight: FontWeight.w600),
                 ),
                 ),
               ),
               ),
             ),
             ),

+ 1 - 1
lib/pages/roomInfo.dart

@@ -66,7 +66,7 @@ class RoomInfoState extends State<RoomInfo> with SingleTickerProviderStateMixin
 
 
 //开始比赛确认按钮
 //开始比赛确认按钮
   showStart() async {
   showStart() async {
-    final result = await Navigator.of(context).push(PageRouteBuilder(
+    bool result = await Navigator.of(context).push<bool>(PageRouteBuilder(
         opaque: false,
         opaque: false,
         transitionDuration: Duration(milliseconds: 300),
         transitionDuration: Duration(milliseconds: 300),
         transitionsBuilder: (BuildContext context, Animation<double> animation, Animation<double> secondaryAnimation, Widget child) {
         transitionsBuilder: (BuildContext context, Animation<double> animation, Animation<double> secondaryAnimation, Widget child) {