panhui 6 rokov pred
rodič
commit
ad9ea89d62
2 zmenil súbory, kde vykonal 10 pridanie a 4 odobranie
  1. 6 1
      lib/pages/MatchPage.dart
  2. 4 3
      lib/pages/TipList.dart

+ 6 - 1
lib/pages/MatchPage.dart

@@ -298,9 +298,14 @@ class _MatchPageState extends State<MatchPage> with WidgetsBindingObserver {
               child: Builder(
                 builder: (context) => InkWell(
                       onTap: () async {
+                        if (timer != null) {
+                          timer.cancel();
+                        }
                         bool result = await Navigator.push(context, CupertinoPageRoute(builder: (context) => TipList()));
                         if (result) {
-                          getUnreadMsg();
+                          timer = Timer.periodic(Duration(seconds: 2), (timer) {
+                            getUnreadMsg();
+                          });
                         }
                       },
                       child: Container(

+ 4 - 3
lib/pages/TipList.dart

@@ -170,8 +170,9 @@ class TipItem extends StatelessWidget {
                   color: Colors.black26,
                 ),
                 // _tipContent(tipInfo.content),
-                Padding(
+                Container(
                   padding: EdgeInsets.only(top: 10, bottom: 15),
+                  width: double.infinity,
                   child:Text.rich( TextSpan(
                     style: TextStyle(color: Colors.white, fontSize: 14),
                     children:_tipContent(tipInfo.content,context)
@@ -197,7 +198,7 @@ class TipItem extends StatelessWidget {
   }
 
   List<TextSpan> _tipContent(content,context) {
-    // String content = '很遗憾,你在2019-06-05 09:23开始的游戏竞赛 [15166的吃鸡房间],[无有效结果],无法获得奖励,该局参赛人数[2]人。';
+    // content = '很遗憾';
     List<String> contentlist1 = content.split('[');
     List<Map> totalContent = [];
     contentlist1.forEach((item) {
@@ -218,6 +219,7 @@ class TipItem extends StatelessWidget {
         });
       }
     });
+
   
 
     List<TextSpan> _widgetList=[];
@@ -232,7 +234,6 @@ class TipItem extends StatelessWidget {
         _widgetList.add(TextSpan(text:item['content']));
       }
     });
-      // print(_widgetList);
 
     return _widgetList;
   }