x1ongzhu 6 jaren geleden
bovenliggende
commit
8d266a94ce
46 gewijzigde bestanden met toevoegingen van 623 en 366 verwijderingen
  1. BIN
      images/2x/download.png
  2. BIN
      images/2x/icon_jiangli.png
  3. BIN
      images/2x/icon_kaishi_putong.png
  4. BIN
      images/2x/icon_kaishi_vip.png
  5. BIN
      images/2x/icon_next_page.png
  6. BIN
      images/2x/img_saishi_01.png
  7. BIN
      images/2x/img_saishi_02.png
  8. BIN
      images/2x/nav_icon_return.png
  9. BIN
      images/2x/zhezhao_01.png
  10. BIN
      images/2x/zhezhao_02.png
  11. BIN
      images/2x/zhezhao_03.png
  12. BIN
      images/2x/矩形.png
  13. BIN
      images/3x/download.png
  14. BIN
      images/3x/icon_jiangli.png
  15. BIN
      images/3x/icon_kaishi_putong.png
  16. BIN
      images/3x/icon_kaishi_vip.png
  17. BIN
      images/3x/icon_next_page.png
  18. BIN
      images/3x/img_saishi_01.png
  19. BIN
      images/3x/img_saishi_02.png
  20. BIN
      images/3x/nav_icon_return.png
  21. BIN
      images/3x/zhezhao_01.png
  22. BIN
      images/3x/zhezhao_02.png
  23. BIN
      images/3x/zhezhao_03.png
  24. BIN
      images/3x/矩形.png
  25. BIN
      images/download.png
  26. BIN
      images/icon_jiangli.png
  27. BIN
      images/icon_kaishi_putong.png
  28. BIN
      images/icon_kaishi_vip.png
  29. BIN
      images/icon_next_page.png
  30. BIN
      images/img_saishi_01.png
  31. BIN
      images/img_saishi_02.png
  32. BIN
      images/nav_icon_return.png
  33. BIN
      images/zhezhao_01.png
  34. BIN
      images/zhezhao_02.png
  35. BIN
      images/zhezhao_03.png
  36. BIN
      images/矩形.png
  37. 3 1
      lib/model/CompetitionInfo.dart
  38. 4 2
      lib/model/CompetitionInfo.g.dart
  39. 2 2
      lib/net/HttpManager.dart
  40. 94 0
      lib/pages/AppNotice.dart
  41. 111 109
      lib/pages/CompetitionRooms.dart
  42. 108 55
      lib/pages/Competitions.dart
  43. 10 69
      lib/pages/Home.dart
  44. 9 1
      lib/pages/RoomInfo.dart
  45. 160 16
      lib/pages/UserGuid.dart
  46. 122 111
      lib/widget/Competition.dart

BIN
images/2x/download.png


BIN
images/2x/icon_jiangli.png


BIN
images/2x/icon_kaishi_putong.png


BIN
images/2x/icon_kaishi_vip.png


BIN
images/2x/icon_next_page.png


BIN
images/2x/img_saishi_01.png


BIN
images/2x/img_saishi_02.png


BIN
images/2x/nav_icon_return.png


BIN
images/2x/zhezhao_01.png


BIN
images/2x/zhezhao_02.png


BIN
images/2x/zhezhao_03.png


BIN
images/2x/矩形.png


BIN
images/3x/download.png


BIN
images/3x/icon_jiangli.png


BIN
images/3x/icon_kaishi_putong.png


BIN
images/3x/icon_kaishi_vip.png


BIN
images/3x/icon_next_page.png


BIN
images/3x/img_saishi_01.png


BIN
images/3x/img_saishi_02.png


BIN
images/3x/nav_icon_return.png


BIN
images/3x/zhezhao_01.png


BIN
images/3x/zhezhao_02.png


BIN
images/3x/zhezhao_03.png


BIN
images/3x/矩形.png


BIN
images/download.png


BIN
images/icon_jiangli.png


BIN
images/icon_kaishi_putong.png


BIN
images/icon_kaishi_vip.png


BIN
images/icon_next_page.png


BIN
images/img_saishi_01.png


BIN
images/img_saishi_02.png


BIN
images/nav_icon_return.png


BIN
images/zhezhao_01.png


BIN
images/zhezhao_02.png


BIN
images/zhezhao_03.png


BIN
images/矩形.png


+ 3 - 1
lib/model/CompetitionInfo.dart

@@ -6,7 +6,8 @@ part 'CompetitionInfo.g.dart';
 class CompetitionInfo {
   CompetitionInfo.empty();
 
-  CompetitionInfo(this.id, this.competitionName, this.startTime, this.endTime, this.type, this.bonus, this.intro, this.pic, this.participatingInfo);
+  CompetitionInfo(
+      this.id, this.competitionName, this.startTime, this.endTime, this.type, this.bonus, this.intro, this.pic, this.participatingInfo, this.awardPic);
 
   factory CompetitionInfo.fromJson(Map<String, dynamic> json) => _$CompetitionInfoFromJson(json);
 
@@ -19,6 +20,7 @@ class CompetitionInfo {
   String intro;
   String pic;
   ParticipatingInfo participatingInfo;
+  String awardPic;
 
   Map<String, dynamic> toJson() => _$CompetitionInfoToJson(this);
 

+ 4 - 2
lib/model/CompetitionInfo.g.dart

@@ -19,7 +19,8 @@ CompetitionInfo _$CompetitionInfoFromJson(Map<String, dynamic> json) {
       json['participatingInfo'] == null
           ? null
           : ParticipatingInfo.fromJson(
-              json['participatingInfo'] as Map<String, dynamic>));
+              json['participatingInfo'] as Map<String, dynamic>),
+      json['awardPic'] as String);
 }
 
 Map<String, dynamic> _$CompetitionInfoToJson(CompetitionInfo instance) =>
@@ -32,5 +33,6 @@ Map<String, dynamic> _$CompetitionInfoToJson(CompetitionInfo instance) =>
       'bonus': instance.bonus,
       'intro': instance.intro,
       'pic': instance.pic,
-      'participatingInfo': instance.participatingInfo
+      'participatingInfo': instance.participatingInfo,
+      'awardPic': instance.awardPic
     };

+ 2 - 2
lib/net/HttpManager.dart

@@ -3,8 +3,8 @@ import 'Result.dart';
 import 'package:intl/intl.dart';
 
 class HttpManager {
-   static String baseUrl = 'http://123.58.240.138:8090/';
-//  static String baseUrl = 'http://192.168.50.132:8080/';
+  //  static String baseUrl = 'http://123.58.240.138:8090/';
+ static String baseUrl = 'http://192.168.50.132:8080/';
   static String token;
   static bool debug;
 

+ 94 - 0
lib/pages/AppNotice.dart

@@ -0,0 +1,94 @@
+import 'package:cached_network_image/cached_network_image.dart';
+import 'package:flutter/material.dart';
+import 'package:wanna_battle/net/HttpManager.dart';
+
+Future<void> getAppNotice(context) async {
+  final res = await HttpManager.get('systemVariable/getOne', data: {
+    'variableName': 'appNotice',
+  });
+  if (res.success) {
+    final String imageUrl = (res.data ?? {})['variableValue'] ?? '';
+    if (imageUrl.isNotEmpty) {
+      showGeneralDialog(
+        context: context,
+        barrierDismissible: true,
+        pageBuilder: (BuildContext buildContext, Animation<double> animation, Animation<double> secondaryAnimation) {
+          return AppNotice(
+            pics: ((res.data ?? {})['variableValue'] ?? '').split(','),
+          );
+        },
+        barrierLabel: MaterialLocalizations.of(context).modalBarrierDismissLabel,
+        barrierColor: Colors.black54,
+        transitionDuration: const Duration(milliseconds: 300),
+      );
+    }
+  }
+}
+
+class AppNotice extends StatefulWidget {
+  final List<String> pics;
+
+  const AppNotice({Key key, this.pics}) : super(key: key);
+
+  @override
+  State<StatefulWidget> createState() {
+    return AppNoticeState();
+  }
+}
+
+class AppNoticeState extends State<AppNotice> {
+  final pageController = PageController(initialPage: 0);
+  int currPage = 0;
+  @override
+  Widget build(BuildContext context) {
+    return Material(
+      color: Colors.transparent,
+      child: Column(
+        mainAxisAlignment: MainAxisAlignment.center,
+        mainAxisSize: MainAxisSize.min,
+        children: <Widget>[
+          SizedBox(
+            width: double.infinity,
+            height: (MediaQuery.of(context).size.width - 56) * 420 / 348,
+            child: PageView(
+              controller: pageController,
+              onPageChanged: (page) {
+                setState(() {
+                  currPage = page;
+                });
+              },
+              children: widget.pics.map<Widget>((f) {
+                return Container(
+                  height: (MediaQuery.of(context).size.width - 56) * 420 / 348,
+                  margin: EdgeInsets.only(left: 28, right: 28),
+                  child: SizedBox(
+                    child: ClipRRect(
+                      borderRadius: BorderRadius.circular(4),
+                      child: CachedNetworkImage(
+                        imageUrl: f,
+                        fit: BoxFit.cover,
+                      ),
+                    ),
+                  ),
+                );
+              }).toList(),
+            ),
+          ),
+          Container(
+            margin: EdgeInsets.only(top: 20),
+            child: GestureDetector(
+              child: Image.asset(currPage == widget.pics.length - 1 ? 'images/icon_guanbi.png' : 'images/icon_next_page.png'),
+              onTap: () {
+                if (currPage == widget.pics.length - 1) {
+                  Navigator.of(context).pop();
+                } else {
+                  pageController.nextPage(duration: Duration(milliseconds: 500), curve: Curves.linearToEaseOut);
+                }
+              },
+            ),
+          )
+        ],
+      ),
+    );
+  }
+}

+ 111 - 109
lib/pages/CompetitionRooms.dart

@@ -1,7 +1,9 @@
+import 'package:cached_network_image/cached_network_image.dart';
 import 'package:flutter/cupertino.dart';
 import 'package:flutter/material.dart';
 import 'package:flutter/widgets.dart';
 import 'package:flutter_redux/flutter_redux.dart';
+import 'package:shared_preferences/shared_preferences.dart';
 import 'package:wanna_battle/model/UserPlayTimes.dart';
 import 'package:wanna_battle/styles/totast.dart';
 import '../model/CompetitionInfo.dart';
@@ -16,6 +18,7 @@ import './CompetitionRank.dart';
 import '../Constants.dart';
 import './CompetitionRank.dart';
 import 'CompetitionNotice.dart';
+import 'UserGuid.dart';
 
 class CompetitionRooms extends StatefulWidget {
   CompetitionRooms(this.competitionInfo);
@@ -35,117 +38,129 @@ class _CompetitionRoomsState extends State<CompetitionRooms> {
   @override
   void initState() {
     super.initState();
-    Future.delayed(Duration.zero, () {
-      showNotice(context);
+    Future.delayed(Duration.zero, () async {
       _getRooms();
       _getPlayTimes();
+      final prefs = await SharedPreferences.getInstance();
+      final bool showGuid2 = prefs.getBool('showGuid2') ?? true;
+      if (showGuid2) {
+        await prefs.setBool('showGuid2', false);
+        await showUserGuide2(context);
+      }
+      showNotice(context);
     });
   }
 
   @override
   Widget build(BuildContext context) {
+    final appBar = AppBar(
+      title: Text(widget.competitionInfo.competitionName),
+      centerTitle: true,
+      elevation: 0,
+      backgroundColor: Colors.transparent,
+    );
     return Scaffold(
-      appBar: AppBar(
-        title: Text(widget.competitionInfo.competitionName),
-        centerTitle: true,
-        elevation: 0,
-      ),
+      backgroundColor: Color(0xff19213B),
       body: Column(
         crossAxisAlignment: CrossAxisAlignment.stretch,
         children: <Widget>[
           Container(
-            color: SUB_COLOR,
-            padding: EdgeInsets.only(left: 15, right: 15, bottom: 10),
+            decoration: BoxDecoration(
+                image: DecorationImage(
+              image: NetworkImage(widget.competitionInfo.pic),
+              fit: BoxFit.cover,
+            )),
+            height: MediaQuery.of(context).size.width * 200 / 375,
+            padding: EdgeInsets.only(left: 15, right: 15),
             child: Column(
               mainAxisAlignment: MainAxisAlignment.center,
               crossAxisAlignment: CrossAxisAlignment.center,
               children: <Widget>[
-                Container(
-                  margin: EdgeInsets.only(top: 10),
-                  child: Text(
-                    widget.competitionInfo.intro ?? '',
-                    style: TextStyle(
-                      color: Color(0xADFFFFFF),
-                      fontSize: 13,
-                    ),
-                  ),
-                ),
-                Container(
-                  color: Colors.yellow,
-                  margin: EdgeInsets.only(top: 10),
-                  padding: EdgeInsets.fromLTRB(6, 1, 6, 2),
-                  child: Text(
-                    '剩余参赛次数 $restTimes次',
-                    style: TextStyle(
-                      color: Color(0xFF293354),
-                      fontSize: 12,
-                    ),
-                  ),
-                ),
-                Container(
-                  margin: EdgeInsets.only(top: 15),
-                  child: Row(
+                appBar,
+                Expanded(
+                  child: Column(
                     children: <Widget>[
-                      Expanded(
-                        child: MaterialButton(
-                          color: Color(0xFFE56B45),
-                          elevation: 0,
-                          highlightElevation: 0,
-                          child: Row(
-                            mainAxisAlignment: MainAxisAlignment.center,
-                            crossAxisAlignment: CrossAxisAlignment.center,
-                            children: <Widget>[
-                              Image.asset(
-                                'images/icon_jiangpin.png',
-                                width: 19,
-                              ),
-                              Container(
-                                margin: EdgeInsets.only(left: 15),
-                                child: Text(
-                                  '奖品规则',
-                                  style: TextStyle(
-                                      color: Colors.white, fontSize: 14),
-                                ),
-                              )
-                            ],
+                      Container(
+                        child: Text(
+                          widget.competitionInfo.intro ?? '',
+                          style: TextStyle(
+                            color: Color(0xADFFFFFF),
+                            fontSize: 13,
+                          ),
+                        ),
+                      ),
+                      Container(
+                        color: Colors.yellow,
+                        margin: EdgeInsets.only(top: 10),
+                        padding: EdgeInsets.fromLTRB(6, 1, 6, 2),
+                        child: Text(
+                          '剩余参赛次数 $restTimes次',
+                          style: TextStyle(
+                            color: Color(0xFF293354),
+                            fontSize: 12,
                           ),
-                          onPressed: () {
-                            showBonus();
-                          },
                         ),
                       ),
-                      Container(width: 15),
-                      Expanded(
-                        child: MaterialButton(
-                          color: PRIMARY_COLOR,
-                          elevation: 0,
-                          highlightElevation: 0,
-                          child: Row(
-                            mainAxisAlignment: MainAxisAlignment.center,
-                            crossAxisAlignment: CrossAxisAlignment.center,
-                            children: <Widget>[
-                              Image.asset(
-                                'images/icon_paihangbang.png',
-                                width: 19,
+                      Container(
+                        margin: EdgeInsets.only(top: 10),
+                        child: Row(
+                          children: <Widget>[
+                            Expanded(
+                              child: MaterialButton(
+                                color: Color(0xFFE56B45),
+                                elevation: 0,
+                                highlightElevation: 0,
+                                child: Row(
+                                  mainAxisAlignment: MainAxisAlignment.center,
+                                  crossAxisAlignment: CrossAxisAlignment.center,
+                                  children: <Widget>[
+                                    Image.asset(
+                                      'images/icon_jiangpin.png',
+                                      width: 19,
+                                    ),
+                                    Container(
+                                      margin: EdgeInsets.only(left: 15),
+                                      child: Text(
+                                        '奖品规则',
+                                        style: TextStyle(color: Colors.white, fontSize: 14),
+                                      ),
+                                    )
+                                  ],
+                                ),
+                                onPressed: () {
+                                  showBonus();
+                                },
                               ),
-                              Container(
-                                margin: EdgeInsets.only(left: 15),
-                                child: Text(
-                                  '排行榜',
-                                  style: TextStyle(
-                                      color: Colors.white, fontSize: 14),
+                            ),
+                            Container(width: 15),
+                            Expanded(
+                              child: MaterialButton(
+                                color: PRIMARY_COLOR,
+                                elevation: 0,
+                                highlightElevation: 0,
+                                child: Row(
+                                  mainAxisAlignment: MainAxisAlignment.center,
+                                  crossAxisAlignment: CrossAxisAlignment.center,
+                                  children: <Widget>[
+                                    Image.asset(
+                                      'images/icon_paihangbang.png',
+                                      width: 19,
+                                    ),
+                                    Container(
+                                      margin: EdgeInsets.only(left: 15),
+                                      child: Text(
+                                        '排行榜',
+                                        style: TextStyle(color: Colors.white, fontSize: 14),
+                                      ),
+                                    )
+                                  ],
                                 ),
-                              )
-                            ],
-                          ),
-                          onPressed: () {
-                            Navigator.push(
-                                context,
-                                CupertinoPageRoute(
-                                    builder: (context) => CompetitionRank(
-                                        competitionId:
-                                            widget.competitionInfo.id)));
-                          },
+                                onPressed: () {
+                                  Navigator.push(context, CupertinoPageRoute(builder: (context) => CompetitionRank(competitionId: widget.competitionInfo.id)));
+                                },
+                              ),
+                            )
+                          ],
                         ),
                       )
                     ],
@@ -173,8 +188,7 @@ class _CompetitionRoomsState extends State<CompetitionRooms> {
   Future<void> _getRooms() async {
     final Result res = await HttpManager.get('houseInfo/all', data: {
       'competitionId': widget.competitionInfo.id,
-      'advancedQuery':
-          ' AND_,status_flag_,!=_,' + HouseStatus.SETTLEMENT.toString(),
+      'advancedQuery': ' AND_,status_flag_,!=_,' + HouseStatus.SETTLEMENT.toString(),
     });
     final List<HouseInfo> list = [];
     if (res.success && res.data != null) {
@@ -212,17 +226,14 @@ class _CompetitionRoomsState extends State<CompetitionRooms> {
     showGeneralDialog(
       context: context,
       barrierDismissible: true,
-      pageBuilder: (BuildContext buildContext, Animation<double> animation,
-          Animation<double> secondaryAnimation) {
+      pageBuilder: (BuildContext buildContext, Animation<double> animation, Animation<double> secondaryAnimation) {
         return Center(
           child: Material(
             color: Colors.transparent,
             child: Container(
               width: 270,
               padding: EdgeInsets.all(0),
-              decoration: BoxDecoration(
-                  color: Color(0xE6293559),
-                  border: Border.all(width: 1, color: Color(0xFF1990F8))),
+              decoration: BoxDecoration(color: Color(0xE6293559), border: Border.all(width: 1, color: Color(0xFF1990F8))),
               child: Column(
                 mainAxisSize: MainAxisSize.min,
                 crossAxisAlignment: CrossAxisAlignment.stretch,
@@ -231,10 +242,7 @@ class _CompetitionRoomsState extends State<CompetitionRooms> {
                     margin: EdgeInsets.only(top: 25),
                     child: Text(
                       '奖品规则',
-                      style: TextStyle(
-                          color: Colors.white,
-                          fontSize: 18,
-                          fontWeight: FontWeight.bold),
+                      style: TextStyle(color: Colors.white, fontSize: 18, fontWeight: FontWeight.bold),
                       textAlign: TextAlign.center,
                     ),
                   ),
@@ -328,9 +336,7 @@ class _Room extends StatelessWidget {
                   style: TextStyle(color: Colors.white, fontSize: 11),
                   children: <TextSpan>[
                     TextSpan(text: '参赛人数:'),
-                    TextSpan(
-                        text: (houseInfo.playerNumber ?? 0).toString(),
-                        style: TextStyle(color: Color(0xFF38A968))),
+                    TextSpan(text: (houseInfo.playerNumber ?? 0).toString(), style: TextStyle(color: Color(0xFF38A968))),
                     TextSpan(text: '/${houseInfo.maxNumber}'),
                   ],
                 ),
@@ -384,15 +390,11 @@ class _Room extends StatelessWidget {
       return;
     }
     Toast.show(context, '加载中', -1, 'loading');
-    Result res = await HttpManager.post('houseInfo/join', data: {
-      'houseId': houseId,
-      'userId': StoreProvider.of<AppState>(context).state.userInfo.id
-    });
+    Result res = await HttpManager.post('houseInfo/join', data: {'houseId': houseId, 'userId': StoreProvider.of<AppState>(context).state.userInfo.id});
     Toast.hide();
     if (res.success) {
       Toast.show(context, '加入成功', 1500, 'success');
-      Navigator.push(context,
-          CupertinoPageRoute(builder: (context) => RoomInfo(houseInfo)));
+      Navigator.push(context, CupertinoPageRoute(builder: (context) => RoomInfo(houseInfo)));
     } else {
       Toast.show(context, res.error, 1500, 'info');
     }

+ 108 - 55
lib/pages/Competitions.dart

@@ -2,6 +2,8 @@ import 'package:flutter/material.dart';
 import 'package:flutter/cupertino.dart';
 import 'package:redux/redux.dart';
 import 'package:flutter_redux/flutter_redux.dart';
+import 'package:url_launcher/url_launcher.dart';
+import 'package:wanna_battle/styles/colors.dart';
 import '../redux/AppState.dart';
 import '../model/UserInfo.dart';
 import 'package:cached_network_image/cached_network_image.dart';
@@ -11,6 +13,7 @@ import '../model/CompetitionInfo.dart';
 import '../widget/Competition.dart';
 import '../widget/CheckinDialog.dart';
 import './BonusDialog.dart';
+import 'AppNotice.dart';
 
 class Competitions extends StatefulWidget {
   Competitions({Key key}) : super(key: key);
@@ -21,17 +24,26 @@ class Competitions extends StatefulWidget {
 
 class _CompetitionState extends State<Competitions> {
   List<CompetitionInfo> competitionInfoList = [];
+  bool showDownload = false;
 
   @override
   void initState() {
     super.initState();
     setState(() {
-      competitionInfoList = PageStorage.of(context)
-              .readState(context, identifier: ValueKey('page1')) ??
-          [];
+      competitionInfoList = PageStorage.of(context).readState(context, identifier: ValueKey('page1')) ?? [];
     });
-    Future.delayed(Duration.zero, () {
+    Future.delayed(Duration.zero, () async {
       _getCompetitions();
+      const url = 'pubgmhd1106467070://';
+      final bool gameInstalled = await canLaunch(url);
+      if (!gameInstalled) {
+        setState(() {
+          showDownload = false;
+        });
+      }
+      setState(() {
+        showDownload = true;
+      });
     });
   }
 
@@ -68,8 +80,7 @@ class _CompetitionState extends State<Competitions> {
                                                 height: 42,
                                               ),
                                               onTap: () {
-                                                Scaffold.of(context)
-                                                    .openDrawer();
+                                                Scaffold.of(context).openDrawer();
                                               },
                                             ),
                                           );
@@ -83,8 +94,7 @@ class _CompetitionState extends State<Competitions> {
                                       height: 42,
                                       margin: EdgeInsets.only(left: 8),
                                       child: Column(
-                                        crossAxisAlignment:
-                                            CrossAxisAlignment.start,
+                                        crossAxisAlignment: CrossAxisAlignment.start,
                                         children: <Widget>[
                                           Text(
                                             userInfo.nickname,
@@ -105,23 +115,16 @@ class _CompetitionState extends State<Competitions> {
                                               //   ),
                                               // ),
                                               Container(
-                                                margin:
-                                                    EdgeInsets.only(left: 0),
-                                                child: Image.asset(
-                                                    'images/icon_jinbi.png'),
+                                                margin: EdgeInsets.only(left: 0),
+                                                child: Image.asset('images/icon_jinbi.png'),
                                               ),
                                               Container(
-                                                margin:
-                                                    EdgeInsets.only(left: 2),
+                                                margin: EdgeInsets.only(left: 2),
                                                 child: Text(
                                                   userInfo.moneyCoin
                                                       .floor()
                                                       .toString()
-                                                      .replaceAllMapped(
-                                                          RegExp(
-                                                              r'(\d{1,3})(?=(\d{3})+(?!\d))'),
-                                                          (Match m) =>
-                                                              '${m[1]},'),
+                                                      .replaceAllMapped(RegExp(r'(\d{1,3})(?=(\d{3})+(?!\d))'), (Match m) => '${m[1]},'),
                                                   style: TextStyle(
                                                     color: Colors.white,
                                                     fontWeight: FontWeight.bold,
@@ -137,37 +140,11 @@ class _CompetitionState extends State<Competitions> {
                                   ),
                                   Container(
                                     margin: EdgeInsets.fromLTRB(10, 0, 15, 0),
-                                    child: InkWell(
-                                      child: Container(
-                                        width: 62,
-                                        height: 32,
-                                        color: Color(0xFFE56B45),
-                                        child: Row(
-                                          children: <Widget>[
-                                            Container(
-                                              margin: EdgeInsets.only(left: 6),
-                                              child: Image.asset(
-                                                'images/icon_jiangpin.png',
-                                                width: 20,
-                                                height: 20,
-                                              ),
-                                            ),
-                                            Container(
-                                              margin: EdgeInsets.only(left: 2),
-                                              child: Text(
-                                                '奖品',
-                                                style: TextStyle(
-                                                  fontSize: 14,
-                                                  color: Colors.white,
-                                                ),
-                                              ),
-                                            )
-                                          ],
-                                        ),
-                                      ),
+                                    child: GestureDetector(
+                                      child: Image.asset('images/icon_jiangli.png'),
                                       onTap: () async {
-                                        showBonusDialog(
-                                            context, competitionInfoList);
+                                        showBonusDialog(context, competitionInfoList);
+                                        // getAppNotice(context);
                                       },
                                     ),
                                   ),
@@ -200,6 +177,86 @@ class _CompetitionState extends State<Competitions> {
 
   List<Widget> buidChildren() {
     List<Widget> list = [];
+    if (showDownload) {
+      list.add(Container(
+        height: 60,
+        padding: EdgeInsets.only(left: 15, right: 15),
+        margin: EdgeInsets.only(top: 15),
+        child: Row(
+          children: <Widget>[
+            Image.asset(
+              'images/download.png',
+              width: 60,
+              height: 60,
+            ),
+            Expanded(
+              child: Column(
+                children: <Widget>[
+                  Expanded(
+                    child: Text(
+                      '如果您还没安装《和平精英》请点击安装!',
+                      style: TextStyle(color: Colors.white, fontSize: 14),
+                    ),
+                  ),
+                  Row(
+                    mainAxisAlignment: MainAxisAlignment.end,
+                    children: <Widget>[
+                      SizedBox(
+                        width: 64,
+                        height: 24,
+                        child: OutlineButton(
+                          borderSide: BorderSide(color: Color(0xff4F5C87)),
+                          splashColor: Color(0xff4F5C87).withAlpha(128),
+                          color: Color(0xff4F5C87),
+                          onPressed: () {
+                            setState(() {
+                              showDownload = false;
+                            });
+                          },
+                          child: Text(
+                            '取消',
+                            style: TextStyle(
+                              color: Color(0xff4F5C87),
+                              fontSize: 12,
+                            ),
+                          ),
+                        ),
+                      ),
+                      Container(
+                        margin: EdgeInsets.only(left: 15),
+                        child: SizedBox(
+                          width: 64,
+                          height: 24,
+                          child: OutlineButton(
+                            borderSide: BorderSide(color: PRIMARY_COLOR),
+                            onPressed: () async {
+                              const url = 'https://gp.qq.com/cp/a20190617versionm/m_version.html?ADTAG=media.buy.baidubrand.title';
+                              if (await canLaunch(url)) {
+                                await launch(url);
+                              }
+                              setState(() {
+                                showDownload = false;
+                              });
+                            },
+                            child: Text(
+                              '下载',
+                              style: TextStyle(
+                                color: PRIMARY_COLOR,
+                                fontSize: 12,
+                              ),
+                            ),
+                          ),
+                        ),
+                      )
+                    ],
+                  )
+                ],
+              ),
+            )
+          ],
+        ),
+      ));
+    }
     list.add(Container(
       height: 56,
       padding: EdgeInsets.only(left: 15, right: 15),
@@ -212,10 +269,7 @@ class _CompetitionState extends State<Competitions> {
             margin: EdgeInsets.only(left: 10, right: 10),
             child: Text(
               '赛事列表',
-              style: TextStyle(
-                  color: Colors.white,
-                  fontSize: 16,
-                  fontWeight: FontWeight.bold),
+              style: TextStyle(color: Colors.white, fontSize: 16, fontWeight: FontWeight.bold),
             ),
           ),
           Expanded(
@@ -239,8 +293,7 @@ class _CompetitionState extends State<Competitions> {
       }
       setState(() {
         competitionInfoList = list;
-        PageStorage.of(context).writeState(context, competitionInfoList,
-            identifier: ValueKey('page1'));
+        PageStorage.of(context).writeState(context, competitionInfoList, identifier: ValueKey('page1'));
       });
     }
   }

+ 10 - 69
lib/pages/Home.dart

@@ -10,6 +10,7 @@ import './Shop.dart';
 import '../widget/CheckUpgrade.dart';
 import '../styles/colors.dart';
 import '../net/HttpManager.dart';
+import 'AppNotice.dart';
 import 'UserGuid.dart';
 
 class HomePage extends StatefulWidget {
@@ -19,8 +20,7 @@ class HomePage extends StatefulWidget {
   _HomePageState createState() => _HomePageState();
 }
 
-class _HomePageState extends State<HomePage>
-    with SingleTickerProviderStateMixin {
+class _HomePageState extends State<HomePage> with SingleTickerProviderStateMixin {
   final List<Tab> myTabs = <Tab>[
     Tab(text: 'LEFT'),
     Tab(text: 'RIGHT'),
@@ -31,11 +31,7 @@ class _HomePageState extends State<HomePage>
 
   int _selectedIndex = 0;
 
-  final List<Widget> _widgetOptions = [
-    Competitions(key: PageStorageKey('page1')),
-    TipList(key: PageStorageKey('page2')),
-    Shop(key: PageStorageKey('page3'))
-  ];
+  final List<Widget> _widgetOptions = [Competitions(key: PageStorageKey('page1')), TipList(key: PageStorageKey('page2')), Shop(key: PageStorageKey('page3'))];
 
   final PageStorageBucket bucket = PageStorageBucket();
 
@@ -45,13 +41,12 @@ class _HomePageState extends State<HomePage>
     _tabController = TabController(vsync: this, length: myTabs.length);
     Future.delayed(Duration.zero, () async {
       final prefs = await SharedPreferences.getInstance();
-      bool isFirstOpen = prefs.getBool('firstOpen') ?? true;
-      if (isFirstOpen) {
-        await showUserGuide(context);
-        await prefs.setBool('firstOpen', false);
+      final bool showGuid1 = prefs.getBool('showGuid1') ?? true;
+      if (showGuid1) {
+        await prefs.setBool('showGuid1', false);
+        await showUserGuide1(context);
       }
-      getAppNotice();
-
+      getAppNotice(context);
       checkUpgrade(context, _dialogKey);
     });
   }
@@ -103,8 +98,7 @@ class _HomePageState extends State<HomePage>
           });
         },
       ),
-      body: PageStorage(
-          bucket: bucket, child: _widgetOptions.elementAt(_selectedIndex)),
+      body: PageStorage(bucket: bucket, child: _widgetOptions.elementAt(_selectedIndex)),
 //      body: CupertinoTabScaffold(
 //        tabBar: CupertinoTabBar(
 //          currentIndex: _selectedIndex,
@@ -149,58 +143,5 @@ class _HomePageState extends State<HomePage>
     );
   }
 
-  Future<void> getAppNotice() async {
-    final res = await HttpManager.get('systemVariable/getOne', data: {
-      'variableName': 'appNotice',
-    });
-    if (res.success) {
-      final String imageUrl = (res.data ?? {})['variableValue'] ?? '';
-      if (imageUrl.isNotEmpty) {
-        showGeneralDialog(
-          context: context,
-          barrierDismissible: true,
-          pageBuilder: (BuildContext buildContext, Animation<double> animation,
-              Animation<double> secondaryAnimation) {
-            return Center(
-              child: Material(
-                color: Colors.transparent,
-                child: Container(
-                  child: Column(
-                    mainAxisSize: MainAxisSize.min,
-                    children: <Widget>[
-                      Container(
-                          width: 320,
-                          height: 375,
-                          padding: EdgeInsets.all(0),
-                          decoration: BoxDecoration(
-                              color: Color(0xE6293559),
-                              border: Border.all(
-                                  width: 1, color: Color(0xFF1990F8))),
-                          child: CachedNetworkImage(
-                            imageUrl: imageUrl,
-                            fit: BoxFit.cover,
-                          )),
-                      Container(
-                        margin: EdgeInsets.only(top: 20),
-                        child: GestureDetector(
-                          child: Image.asset('images/icon_guanbi.png'),
-                          onTap: () {
-                            Navigator.of(context).pop();
-                          },
-                        ),
-                      )
-                    ],
-                  ),
-                ),
-              ),
-            );
-          },
-          barrierLabel:
-              MaterialLocalizations.of(context).modalBarrierDismissLabel,
-          barrierColor: Colors.black54,
-          transitionDuration: const Duration(milliseconds: 300),
-        );
-      }
-    }
-  }
 }
+

+ 9 - 1
lib/pages/RoomInfo.dart

@@ -1,5 +1,6 @@
 import 'package:flutter/material.dart';
 import 'package:flutter_screenutil/flutter_screenutil.dart';
+import 'package:shared_preferences/shared_preferences.dart';
 import 'package:url_launcher/url_launcher.dart';
 import '../styles/colors.dart';
 import 'dart:ui';
@@ -17,6 +18,7 @@ import 'dart:async';
 import '../widget/Dialog.dart';
 import 'SecondRoomInfo.dart';
 import 'package:flutter/cupertino.dart';
+import 'UserGuid.dart';
 import 'VideoPlayer.dart';
 import './CompetitionNotice.dart';
 
@@ -283,8 +285,14 @@ class RoomInfoState extends State<RoomInfo> with SingleTickerProviderStateMixin
     _tipController = ScrollController();
     roomInfo = {};
 
-    Future.delayed(Duration.zero, () {
+    Future.delayed(Duration.zero, () async {
       getRoomInfo();
+      final prefs = await SharedPreferences.getInstance();
+      final bool showGuid3 = prefs.getBool('showGuid3') ?? true;
+      if (showGuid3) {
+        await prefs.setBool('showGuid3', false);
+        await showUserGuide3(context);
+      }
     });
   }
 

+ 160 - 16
lib/pages/UserGuid.dart

@@ -8,8 +8,7 @@ Future showUserGuide(BuildContext context) {
     PageRouteBuilder(
       opaque: false,
       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) {
         return FadeTransition(
           opacity: CurvedAnimation(parent: animation, curve: Curves.linear),
           child: child,
@@ -106,11 +105,7 @@ class UserGuideState extends State<UserGuide> {
                   Align(
                     alignment: Alignment.topCenter,
                     child: Container(
-                      margin: EdgeInsets.only(
-                          top: (MediaQuery.of(context).size.width - 30) *
-                                  150 /
-                                  345 +
-                              133),
+                      margin: EdgeInsets.only(top: (MediaQuery.of(context).size.width - 30) * 150 / 345 + 133),
                       child: Image.asset('images/zhezhao_04.png'),
                     ),
                   ),
@@ -118,10 +113,7 @@ class UserGuideState extends State<UserGuide> {
                     alignment: Alignment.topCenter,
                     child: Container(
                       margin: EdgeInsets.only(
-                        top: (MediaQuery.of(context).size.width - 30) *
-                                150 /
-                                345 +
-                            285,
+                        top: (MediaQuery.of(context).size.width - 30) * 150 / 345 + 285,
                       ),
                       child: Text(
                         '03、点击进入,开始您的比赛吧',
@@ -138,8 +130,7 @@ class UserGuideState extends State<UserGuide> {
     );
   }
 
-  Widget _page(BuildContext context,
-      {@required List<Widget> children, bool isLast = false}) {
+  Widget _page(BuildContext context, {@required List<Widget> children, bool isLast = false}) {
     List<Widget> list = [
       Align(
         alignment: Alignment.bottomCenter,
@@ -157,9 +148,7 @@ class UserGuideState extends State<UserGuide> {
                   Navigator.of(context).pop();
                   return;
                 }
-                pageController.nextPage(
-                    duration: Duration(milliseconds: 300),
-                    curve: Curves.linearToEaseOut);
+                pageController.nextPage(duration: Duration(milliseconds: 300), curve: Curves.linearToEaseOut);
               },
               child: Text(
                 isLast ? '知道了' : '下一步',
@@ -193,3 +182,158 @@ class UserGuideState extends State<UserGuide> {
     );
   }
 }
+
+Future showUserGuide1(BuildContext context) {
+  return 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 Material(
+          color: Colors.black54,
+          child: GestureDetector(
+            child: Container(
+              child: Stack(
+                children: <Widget>[
+                  Container(
+                    margin: EdgeInsets.only(top: (MediaQuery.of(context).size.width - 30) * 186 / 345 + 133, right: 0),
+                    child: Align(
+                      alignment: Alignment.topRight,
+                      child: Image.asset('images/zhezhao_01.png'),
+                    ),
+                  ),
+                  Align(
+                    alignment: Alignment.topCenter,
+                    child: Container(
+                      width: 200,
+                      margin: EdgeInsets.only(top: (MediaQuery.of(context).size.width - 30) * 186 / 345 + 90),
+                      child: Text(
+                        '成为VIP后可以参与专属赛事赢得精美大奖',
+                        style: TextStyle(color: Colors.white, fontSize: 16, fontWeight: FontWeight.bold),
+                      ),
+                    ),
+                  )
+                ],
+              ),
+            ),
+            onTap: () {
+              Navigator.of(context).pop();
+            },
+          ),
+        );
+      },
+    ),
+  );
+}
+
+Future showUserGuide2(BuildContext context) {
+  return 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 Material(
+          color: Colors.black54,
+          child: GestureDetector(
+            child: Container(
+              child: Stack(
+                children: <Widget>[
+                  Positioned(
+                    top: (MediaQuery.of(context).size.width - 30) * 186 / 345 + 0,
+                    right: 6,
+                    left: 6,
+                    child: Container(
+                      child: Image.asset(
+                        'images/zhezhao_02.png',
+                        fit: BoxFit.fitWidth,
+                      ),
+                    ),
+                  ),
+                  Align(
+                    alignment: Alignment.topCenter,
+                    child: Container(
+                      width: 200,
+                      margin: EdgeInsets.only(top: (MediaQuery.of(context).size.width - 30) * 186 / 345, right: 60),
+                      child: Text(
+                        '选择一个等待中的房间进入即可参与本次比赛',
+                        style: TextStyle(color: Colors.white, fontSize: 16, fontWeight: FontWeight.bold),
+                      ),
+                    ),
+                  )
+                ],
+              ),
+            ),
+            onTap: () {
+              Navigator.of(context).pop();
+            },
+          ),
+        );
+      },
+    ),
+  );
+}
+
+Future showUserGuide3(BuildContext context) {
+  return 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 Material(
+          color: Colors.black54,
+          child: GestureDetector(
+            child: Container(
+              child: Stack(
+                children: <Widget>[
+                  Positioned(
+                    bottom: 5,
+                    right: 6,
+                    left: 6,
+                    child: Container(
+                      child: Image.asset(
+                        'images/zhezhao_03.png',
+                        fit: BoxFit.fitWidth,
+                      ),
+                    ),
+                  ),
+                  Align(
+                    alignment: Alignment.bottomCenter,
+                    child: Container(
+                      width: 200,
+                      margin: EdgeInsets.only(bottom: 122, right: 60),
+                      child: Text(
+                        '加入房间后等待倒计时结束\n或者房主手动开启比赛',
+                        style: TextStyle(color: Colors.white, fontSize: 16, fontWeight: FontWeight.bold),
+                      ),
+                    ),
+                  )
+                ],
+              ),
+            ),
+            onTap: () {
+              Navigator.of(context).pop();
+            },
+          ),
+        );
+      },
+    ),
+  );
+}

+ 122 - 111
lib/widget/Competition.dart

@@ -3,6 +3,7 @@ import 'package:flutter/material.dart';
 import 'package:flutter/cupertino.dart';
 import 'package:cached_network_image/cached_network_image.dart';
 import 'package:gradient_text/gradient_text.dart';
+import 'package:wanna_battle/net/HttpManager.dart';
 import 'package:wanna_battle/styles/colors.dart';
 import '../pages/CompetitionRank.dart';
 import '../model/CompetitionInfo.dart';
@@ -17,103 +18,131 @@ class Competition extends StatelessWidget {
   Widget build(BuildContext context) {
     return GestureDetector(
       child: Container(
-        margin: EdgeInsets.fromLTRB(15, 7, 15, 7),
-        child: Column(
-          crossAxisAlignment: CrossAxisAlignment.stretch,
-          children: <Widget>[
-            Stack(
-              overflow: Overflow.visible,
-              children: <Widget>[
-                AspectRatio(
-                  aspectRatio: 345 / 150,
-                  child: CachedNetworkImage(
-                    imageUrl: competitionInfo.pic,
-                    fit: BoxFit.cover,
-                  ),
+        margin: EdgeInsets.only(left: 15, right: 15, bottom: 15),
+        child: AspectRatio(
+          aspectRatio: 345 / 186,
+          child: Stack(
+            children: <Widget>[
+              AspectRatio(
+                aspectRatio: 345 / 186,
+                child: CachedNetworkImage(
+                  imageUrl: competitionInfo.pic,
+                  fit: BoxFit.cover,
                 ),
-                Align(
-                  alignment: Alignment.topLeft,
-                  child: competitionInfo.type == 2
-                      ? Image.asset('images/home_icon_vip.png')
-                      : Container(),
+              ),
+              AspectRatio(
+                aspectRatio: 345 / 136,
+                child: Container(
+                  decoration: BoxDecoration(
+                      gradient: LinearGradient(
+                    colors: [Color(0xff000000).withAlpha(128), Color(0xff000000).withAlpha(0)],
+                    begin: Alignment.topCenter,
+                    end: Alignment.bottomCenter,
+                  )),
                 ),
-                Positioned(
-                  right: 10,
-                  top: -2,
-                  width: 52,
-                  height: 35,
-                  child: GestureDetector(
-                    child: Container(
-                      transform: Matrix4.translationValues(0.0, -2.0, 0.0),
-                      child: Builder(
-                        builder: (context) {
-                          var src = 'images/icon_paimingno.png';
-                          if (competitionInfo.participatingInfo != null &&
-                              competitionInfo.participatingInfo.rank > 0) {
-                            if (competitionInfo.participatingInfo.rank == 1) {
-                              src = 'images/icon_paiming01.png';
-                            } else if (competitionInfo.participatingInfo.rank ==
-                                2) {
-                              src = 'images/icon_paiming02.png';
-                            } else if (competitionInfo.participatingInfo.rank ==
-                                3) {
-                              src = 'images/icon_paiming03.png';
-                            } else {
-                              return Stack(
-                                children: <Widget>[
-                                  Image.asset('images/icon_paiming0000.png'),
-                                  Align(
-                                    alignment: Alignment.topCenter,
-                                    child: Container(
-                                      margin: EdgeInsets.only(top: 10),
-                                      child: Text(
-                                        competitionInfo.participatingInfo.rank
-                                            .toString(),
-                                        style: TextStyle(
-                                          fontSize: 16,
-                                          fontWeight: FontWeight.bold,
-                                          color: Colors.white,
-                                        ),
-                                      ),
-                                    ),
-                                  ),
-                                ],
-                              );
-                            }
-                          }
-                          return Image.asset(src);
-                        },
+              ),
+              Align(
+                alignment: Alignment.topLeft,
+                child: Container(
+                  margin: EdgeInsets.only(top: 13, left: 15),
+                  child: Row(
+                    children: <Widget>[
+                      Text(
+                        competitionInfo.competitionName,
+                        style: TextStyle(
+                          color: Colors.white,
+                          fontSize: 18,
+                          fontWeight: FontWeight.bold,
+                        ),
                       ),
+                      Container(
+                        height: 20,
+                        margin: EdgeInsets.only(left: 6),
+                        decoration: BoxDecoration(borderRadius: BorderRadius.circular(2), color: Colors.white),
+                        padding: EdgeInsets.only(left: 4, right: 4),
+                        child: GestureDetector(
+                          child: Center(
+                            child: Text(
+                              competitionInfo.participatingInfo?.rank != null ? ('第' + competitionInfo.participatingInfo.rank.toString() + '名') : '未上榜',
+                              style: TextStyle(
+                                color: Color(0xff19213B),
+                                fontSize: 12,
+                              ),
+                            ),
+                          ),
+                          onTap: () {
+                            Navigator.push(context, CupertinoPageRoute(builder: (context) => CompetitionRank(competitionId: competitionInfo.id)));
+                          },
+                        ),
+                      )
+                    ],
+                  ),
+                ),
+              ),
+              Align(
+                alignment: Alignment.topLeft,
+                child: Container(
+                  margin: EdgeInsets.only(top: 44, left: 15),
+                  child: Text(
+                    readTimestamp(competitionInfo.startTime, 'yyyy.MM.dd') + '-' + readTimestamp(competitionInfo.endTime, 'yyyy.MM.dd'),
+                    style: TextStyle(
+                      color: Colors.white,
+                      fontSize: 12,
                     ),
-                    onTap: () {
-                      Navigator.push(
-                          context,
-                          CupertinoPageRoute(
-                              builder: (context) => CompetitionRank(
-                                  competitionId: competitionInfo.id)));
-                    },
                   ),
                 ),
-              ],
-            ),
-            Container(
-              height: 36,
-              color: PRIMARY_COLOR,
-              child: Center(
-                child: Text(
-                  '进入',
-                  style: TextStyle(color: Colors.white, fontSize: 14),
+              ),
+              Align(
+                alignment: Alignment.topLeft,
+                child: Container(
+                  decoration: BoxDecoration(border: Border.all(width: 1, color: Colors.white)),
+                  padding: EdgeInsets.only(left: 2, right: 2),
+                  margin: EdgeInsets.only(top: 82, left: 15),
+                  child: Text(
+                    '赛事奖励',
+                    style: TextStyle(
+                      color: Colors.white,
+                      fontSize: 12,
+                    ),
+                  ),
                 ),
               ),
-            )
-          ],
+              Align(
+                alignment: Alignment.bottomLeft,
+                child: Container(
+                  margin: EdgeInsets.only(left: 15, bottom: 12),
+                  child: Row(
+                    children: competitionInfo.awardPic.split(',').map<Widget>((f) {
+                      return Container(
+                        width: 60,
+                        height: 60,
+                        margin: EdgeInsets.only(right: 5),
+                        decoration: BoxDecoration(
+                          borderRadius: BorderRadius.circular(2),
+                          color: Colors.white,
+                        ),
+                        child: CachedNetworkImage(
+                          imageUrl: f,
+                          fit: BoxFit.contain,
+                        ),
+                      );
+                    }).toList(),
+                  ),
+                ),
+              ),
+              Align(
+                alignment: Alignment.bottomRight,
+                child: Container(
+                  margin: EdgeInsets.only(bottom: 12),
+                  child: Image.asset(competitionInfo.type == 2 ? 'images/icon_kaishi_vip.png' : 'images/icon_kaishi_putong.png'),
+                ),
+              )
+            ],
+          ),
         ),
       ),
       onTap: () {
-        Navigator.push(
-            context,
-            CupertinoPageRoute(
-                builder: (context) => CompetitionRooms(competitionInfo)));
+        Navigator.push(context, CupertinoPageRoute(builder: (context) => CompetitionRooms(competitionInfo)));
       },
     );
   }
@@ -158,18 +187,9 @@ class CompetitionOld extends StatelessWidget {
                           ),
                           Expanded(
                             child: GradientText(
-                                '¥' +
-                                    competitionInfo.bonus
-                                        .toString()
-                                        .replaceAllMapped(
-                                            RegExp(
-                                                r'(\d{1,3})(?=(\d{3})+(?!\d))'),
-                                            (Match m) => '${m[1]},'),
+                                '¥' + competitionInfo.bonus.toString().replaceAllMapped(RegExp(r'(\d{1,3})(?=(\d{3})+(?!\d))'), (Match m) => '${m[1]},'),
                                 gradient: LinearGradient(
-                                  colors: [
-                                    Color(0xFFFFC84B),
-                                    Color(0xFFA26A23)
-                                  ],
+                                  colors: [Color(0xFFFFC84B), Color(0xFFA26A23)],
                                   begin: Alignment.topCenter,
                                   end: Alignment.bottomCenter,
                                 ),
@@ -178,13 +198,9 @@ class CompetitionOld extends StatelessWidget {
                           ),
                           Text(
                             '比赛时间' +
-                                DateFormat('yyyy.MM.dd').format(
-                                    DateTime.fromMicrosecondsSinceEpoch(
-                                        competitionInfo.startTime * 1000)) +
+                                DateFormat('yyyy.MM.dd').format(DateTime.fromMicrosecondsSinceEpoch(competitionInfo.startTime * 1000)) +
                                 '-' +
-                                DateFormat('yyyy.MM.dd').format(
-                                    DateTime.fromMicrosecondsSinceEpoch(
-                                        competitionInfo.endTime * 1000)),
+                                DateFormat('yyyy.MM.dd').format(DateTime.fromMicrosecondsSinceEpoch(competitionInfo.endTime * 1000)),
                             style: TextStyle(
                               color: Color(0xFF9A9CA2),
                               fontSize: 11,
@@ -228,8 +244,7 @@ class CompetitionOld extends StatelessWidget {
                 child: Builder(
                   builder: (context) {
                     var src = 'images/icon_paimingno.png';
-                    if (competitionInfo.participatingInfo != null &&
-                        competitionInfo.participatingInfo.rank > 0) {
+                    if (competitionInfo.participatingInfo != null && competitionInfo.participatingInfo.rank > 0) {
                       if (competitionInfo.participatingInfo.rank == 1) {
                         src = 'images/icon_paiming01.png';
                       } else if (competitionInfo.participatingInfo.rank == 2) {
@@ -245,8 +260,7 @@ class CompetitionOld extends StatelessWidget {
                               child: Container(
                                 margin: EdgeInsets.only(top: 10),
                                 child: Text(
-                                  competitionInfo.participatingInfo.rank
-                                      .toString(),
+                                  competitionInfo.participatingInfo.rank.toString(),
                                   style: TextStyle(
                                     fontSize: 16,
                                     fontWeight: FontWeight.bold,
@@ -279,10 +293,7 @@ class CompetitionOld extends StatelessWidget {
         ),
       ),
       onTap: () {
-        Navigator.push(
-            context,
-            CupertinoPageRoute(
-                builder: (context) => CompetitionRooms(competitionInfo)));
+        Navigator.push(context, CupertinoPageRoute(builder: (context) => CompetitionRooms(competitionInfo)));
       },
     );
   }